Logging

More...

Classes:

Enumerations

enum
LogLevel {
  normal 
  warning 
  error 
}

Priority levels for logging entries.

Functions

void
dumpConsoleClasses(bool dumpScript, bool dumpEngine)

Dumps all declared console classes to the console.

void
dumpConsoleFunctions(bool dumpScript, bool dumpEngine)

Dumps all declared console functions to the console.

void
echo(string message...)

Logs a message to the console.

void
error(string message...)

Logs an error message to the console.

void
log(string message)

Logs a message to the console.

void
logError(string message)

Logs an error message to the console.

void
logWarning(string message)

Logs a warning message to the console.

void
setLogMode(int mode)

Determines how log files are written.

void
warn(string message...)

Logs a warning message to the console.

Detailed Description

Enumerations

LogLevel

Enumerator

normal

...

Lowest priority level, no highlighting.

warning

Mid level priority, tags and highlights possible issues in blue.

error

Highest priority level, extreme emphasis on this entry. Highlighted in red.

Priority levels for logging entries.

Functions

dumpConsoleClasses(bool dumpScript, bool dumpEngine)

Dumps all declared console classes to the console.

Parameters:

dumpScript

Optional parameter specifying whether or not classes defined in script should be dumped.

dumpEngine

Optional parameter specifying whether or not classes defined in the engine should be dumped.

dumpConsoleFunctions(bool dumpScript, bool dumpEngine)

Dumps all declared console functions to the console.

Parameters:

dumpScript

Optional parameter specifying whether or not functions defined in script should be dumped.

dumpEngine

Optional parameter specitying whether or not functions defined in the engine should be dumped.

echo(string message...)

Logs a message to the console.

Concatenates all given arguments to a single string and prints the string to the console. A newline is added automatically after the text.

Parameters:

message

Any number of string arguments.

error(string message...)

Logs an error message to the console.

Concatenates all given arguments to a single string and prints the string to the console as an error message (in the in-game console, these will show up using a red font by default). A newline is added automatically after the text.

Parameters:

message

Any number of string arguments.

log(string message)

Logs a message to the console.

Parameters:

message

The message text.

note:

By default, messages will appear white in the console.

logError(string message)

Logs an error message to the console.

Parameters:

message

The message text.

note:

By default, errors will appear red in the console.

logWarning(string message)

Logs a warning message to the console.

Parameters:

message

The message text.

note:

By default, warnings will appear turquoise in the console.

setLogMode(int mode)

Determines how log files are written.

Sets the operational mode of the console logging system.

Parameters:

mode

Parameter specifying the logging mode. This can be:

  • 1: Open and close the console log file for each seperate string of output. This will ensure that all parts get written out to disk and that no parts remain in intermediate buffers even if the process crashes.

  • 2: Keep the log file open and write to it continuously. This will make the system operate faster but if the process crashes, parts of the output may not have been written to disk yet and will be missing from the log.

Additionally, when changing the log mode and thus opening a new log file, either of the two mode values may be combined by binary OR with 0x4 to cause the logging system to flush all console log messages that had already been issued to the console system into the newly created log file.

note:

Xbox 360 does not support logging to a file. Use Platform::OutputDebugStr in C++ instead.

warn(string message...)

Logs a warning message to the console.

Concatenates all given arguments to a single string and prints the string to the console as a warning message (in the in-game console, these will show up using a turquoise font by default). A newline is added automatically after the text.

Parameters:

message

Any number of string arguments.