# AILog Class Reference

Class that handles all log related functions. More...

`#include <ai_log.hpp>`

Inheritance diagram for AILog:

## Public Types

enum | AILogType { LOG_SQ_ERROR = 0, LOG_ERROR = 1, LOG_SQ_INFO = 2, LOG_WARNING = 3, LOG_INFO = 4 }
| Log levels; The value is also feed to DEBUG() lvl. More...

## Static Public Member Functions

static const char * | GetClassName ()
static void | Info (const char *message)
| Print an Info message to the logs.
static void | Warning (const char *message)
| Print a Warning message to the logs.
static void | Error (const char *message)
| Print an Error message to the logs.
static void | FreeLogPointer ()
| Free the log pointer.

## Static Private Member Functions

static void | Log (AILog::AILogType level, const char *message)
| Internal command to log the message in a common way.

## Friends

class | AIController

## Data Structures

struct | LogData
| Internal representation of the log-data inside the AI. More...

## Detailed Description

Class that handles all log related functions.

Definition at line 13 of file ai_log.hpp.

## Member Enumeration Documentation

enum AILog::AILogType

Log levels; The value is also feed to DEBUG() lvl.

This has no use for you, as AI writer.

Enumerator:

  LOG_SQ_ERROR | Squirrel printed an error.
  LOG_ERROR | User printed an error.
  LOG_SQ_INFO | Squirrel printed some info.
  LOG_WARNING | User printed some warning.
  LOG_INFO | User printed some info.

Definition at line 26 of file ai_log.hpp.

## Member Function Documentation

void AILog::Info | ( | const char * | message | ) | `[static]`

Print an Info message to the logs.

Parameters:

  | message | The message to log.

Definition at line 11 of file ai_log.cpp.

References Log(), and LOG_INFO.

void AILog::Warning | ( | const char * | message | ) | `[static]`

Print a Warning message to the logs.

Parameters:

  | message | The message to log.

Definition at line 16 of file ai_log.cpp.

References Log(), and LOG_WARNING.

Referenced by AIOrder::ChangeOrder(), and AIController::Sleep().

void AILog::Error | ( | const char * | message | ) | `[static]`

Print an Error message to the logs.

Parameters:

  | message | The message to log.

Definition at line 21 of file ai_log.cpp.

References Log(), and LOG_ERROR.

void AILog::FreeLogPointer | ( |  | ) | `[static]`

Free the log pointer.

Note:
  DO NOT CALL YOURSELF; leave it to the internal AI programming.

Definition at line 73 of file ai_log.cpp.

References AILog::LogData::count, AIObject::GetLogPointer(), AILog::LogData::lines, and AILog::LogData::type.

The documentation for this class was generated from the following files:

- src/ai/api/ai_log.hpp
- src/ai/api/ai_log.cpp