Menu
Lumberyard
Developer Guide (Version 1.11)

CryLog

CryLog Logging Functionality

You can log in Lumberyard by using the following global functions.

  • CryLog (eMessage)

  • CryLogAlways (eAlways)

  • CryError (eError)

  • CryWarning (eWarning)

  • CryComment (eComment)

If more control is required, the ILog interface can be used directly by using the following syntax.

Copy
gEnv->pLog->LogToFile("value %d",iVal);

Verbosity Level and Coloring

You can control the verbosity of logging with the console variables log_Verbosity and log_FileVerbosity.

The following table shows the levels of verbosity and color convention. In the console, warnings appear in yellow, and errors appear in red.

Message verbosity 0 verbosity 1 verbosity 2 verbosity 3 verbosity 4 Color in console
eAlways X X X X X
eErrorAlways X X X X X red
eWarningAlways X X X X X yellow
eInput ? ? ? ? ?
eInputResponse ? ? ? ? ?
eError X X X X red
eWarning - - X X X yellow
eMessage - - X X
eComment - - - - X

Key

  • X – the message type is logged to the console or file

  • ? – some special logic is involved

Tip

Full logging (to console and file) can be enabled by using log_Verbosity 4.

Log Files

The following log file sources write to the log files indicated.

Source Log file
Lumberyard Editor Editor.log
Game game.log (default)
Error messages Error.log

Console Variables

The following console variables relate to logging.

log_IncludeTime

Copy
Toggles time stamping of log entries. Usage: log_IncludeTime [0/1/2/3/4/5] 0=off (default) 1=current time 2=relative time 3=current+relative time 4=absolute time in seconds since this mode was started 5=current time+server time

ai_LogFileVerbosity

Copy
None = 0, progress/errors/warnings = 1, event = 2, comment = 3

log_Verbosity DUMPTODISK

Copy
defines the verbosity level for log messages written to console -1=suppress all logs (including eAlways) 0=suppress all logs(except eAlways) 1=additional errors 2=additional warnings 3=additional messages 4=additional comments