# AILog Class Reference

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

`#include <ai_log.hpp>`

Inheritance diagram for AILog:

## Data Structures
struct | LogData
| Internal representation of the log-data inside the AI. More...
## 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 ()
| Get the name of this class to identify it towards squirrel.
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

## Detailed Description

Class that handles all log related functions.

Definition at line 20 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 34 of file ai_log.hpp.

## Member Function Documentation

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

Print an Error message to the logs.

Parameters:

  | message | The message to log.

Definition at line 29 of file ai_log.cpp.

References Log(), and LOG_ERROR.

Referenced by AIInstance::GameLoop(), AIInstance::LoadCompatibilityScripts(), AIInstance::Save(), and AIInstance::SaveObject().

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

Free the log pointer.

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

Definition at line 81 of file ai_log.cpp.

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

static const char* AILog::GetClassName | ( |  | ) | `[inline, static]`

Get the name of this class to identify it towards squirrel.

Definition at line 27 of file ai_log.hpp.

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

Print an Info message to the logs.

Parameters:

  | message | The message to log.

Definition at line 19 of file ai_log.cpp.

References Log(), and LOG_INFO.

Referenced by AIInstance::Died().

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

Print a Warning message to the logs.

Parameters:

  | message | The message to log.

Definition at line 24 of file ai_log.cpp.

References Log(), and LOG_WARNING.

Referenced by AIInstance::CallLoad(), AIInstance::LoadCompatibilityScripts(), AIInstance::Save(), and AIController::Sleep().

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

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