Logging

Overview

It can often be useful to log text to the console, an in-game utility opened with the tilde key, or to a text file. The CRYENGINE console exposes this through the ILog interface.

CryLog functions

Logging can be performed with the CryLog* functions, see the table further along.

Anything logged to console is also logged to file, based on the log_verbosity and log_writeToFileVerbosity console variable settings (also called CVars). The verbosity indicates which messages should be logged/displayed, and is very useful for filtering out messages:

Verbosity LevelDisplayed withDescription
-1N/ANo logging
0CryLogAlways (ILog::eAlways)Suppresses all logged information, excluding anything logged using the CryLogAlways function.
1The above, and ILog::eErrorLogs the above and errors.
2The above, and CryWarning (ILog::eWarning)Logs the above and warnings.
3The above, and CryLog (ILog::eMessage)Logs the above and additional messages.
4The above, and CryComment (ILog::eComment)Logs the above and additional trivial comments.

Conclusion

This concludes the article on logging, you may be interested in: