Log¶
Description¶
Log provides static methods for writing messages to the platform console or log sink. Output goes to the IDE console during editor play mode, and to stdout/logcat/Xcode console on each platform. All methods accept printf-style format strings.
In Lua, the global print() function is also available as an alias for Log.print.
Methods¶
| Returns | Name | Languages |
|---|---|---|
| static void | C++ | Lua | |
| static void | verbose | C++ | Lua |
| static void | debug | C++ | Lua |
| static void | warn | C++ | Lua |
| static void | error | C++ | Lua |
Log levels¶
The engine filters messages based on the build configuration (defined in System.h):
| Macro | Level | Description |
|---|---|---|
S_LOG_VERBOSE |
1 | Detailed trace information; typically disabled in release builds. |
S_LOG_DEBUG |
2 | Debug-level messages useful during development. |
S_LOG_WARN |
3 | Non-fatal warnings that may indicate incorrect usage. |
S_LOG_ERROR |
4 | Errors that require attention; may terminate the operation. |
Method details¶
print¶
static void print(const char* text, ...)
Writes a plain message to the log with no severity prefix. Use for general informational output and debugging.
verbose¶
static void verbose(const char* text, ...)
Logs a VERBOSE-level message. Typically compiled out in release; use for high-frequency trace output such as per-frame diagnostics.
debug¶
static void debug(const char* text, ...)
Logs a DEBUG-level message. Use for state dumps, object creation, and lifecycle tracking during active development.
warn¶
static void warn(const char* text, ...)
Logs a WARN-level message. Use for recoverable issues: missing optional resources, fallback paths taken, or unexpected but non-fatal conditions.
error¶
static void error(const char* text, ...)
Logs an ERROR-level message. Use for critical failures that prevent correct execution.