Static logging interface.
More...
#include <Log.hpp>
|
| static void | init () |
| | Initializes the logging system.
|
| static void | shutdown () |
| | Shuts down the logging system.
|
| static void | setLevel (LogLevel level) |
| | Sets the minimum log level.
|
| static LogLevel | getLevel () |
| | Gets the current minimum log level.
|
| static u32 | addSink (LogSink sink) |
| | Registers a log sink to receive log entries.
|
| static void | removeSink (u32 sinkId) |
| | Unregisters a log sink.
|
| template<typename... Args> |
| static void | trace (const char *fmt, Args &&... args) |
| | Logs a trace message.
|
| template<typename... Args> |
| static void | debug (const char *fmt, Args &&... args) |
| | Logs a debug message.
|
| template<typename... Args> |
| static void | info (const char *fmt, Args &&... args) |
| | Logs an info message.
|
| template<typename... Args> |
| static void | warn (const char *fmt, Args &&... args) |
| | Logs a warning message.
|
| template<typename... Args> |
| static void | error (const char *fmt, Args &&... args) |
| | Logs an error message.
|
| template<typename... Args> |
| static void | fatal (const char *fmt, Args &&... args) |
| | Logs a fatal error message.
|
Static logging interface.
Provides formatted logging with severity levels. Uses a simple {} placeholder syntax for formatting arguments.
Log::info(
"Player {} scored {} points", playerName, score);
static void info(const char *fmt, Args &&... args)
Logs an info message.
static void error(const char *fmt, Args &&... args)
Logs an error message.
- Note
- For convenience, use the ES_LOG_* macros which provide the same functionality with automatic debug stripping.
Definition at line 82 of file Log.hpp.
◆ addSink()
Registers a log sink to receive log entries.
- Parameters
-
| sink | Callback function to receive log entries |
- Returns
- Sink ID for unregistration
Definition at line 62 of file Log.cpp.
References esengine::sink().
◆ debug()
template<typename... Args>
| void esengine::Log::debug |
( |
const char * | fmt, |
|
|
Args &&... | args ) |
|
inlinestatic |
Logs a debug message.
- Template Parameters
-
| Args | Format argument types |
- Parameters
-
| fmt | Format string with {} placeholders |
| args | Format arguments |
Definition at line 141 of file Log.hpp.
References esengine::Debug.
◆ error()
template<typename... Args>
| void esengine::Log::error |
( |
const char * | fmt, |
|
|
Args &&... | args ) |
|
inlinestatic |
Logs an error message.
- Template Parameters
-
| Args | Format argument types |
- Parameters
-
| fmt | Format string with {} placeholders |
| args | Format arguments |
Definition at line 174 of file Log.hpp.
References esengine::Error.
◆ fatal()
template<typename... Args>
| void esengine::Log::fatal |
( |
const char * | fmt, |
|
|
Args &&... | args ) |
|
inlinestatic |
Logs a fatal error message.
- Template Parameters
-
| Args | Format argument types |
- Parameters
-
| fmt | Format string with {} placeholders |
| args | Format arguments |
Definition at line 185 of file Log.hpp.
References esengine::Fatal.
◆ getLevel()
Gets the current minimum log level.
- Returns
- The current log level threshold
Definition at line 46 of file Log.cpp.
◆ info()
template<typename... Args>
| void esengine::Log::info |
( |
const char * | fmt, |
|
|
Args &&... | args ) |
|
inlinestatic |
Logs an info message.
- Template Parameters
-
| Args | Format argument types |
- Parameters
-
| fmt | Format string with {} placeholders |
| args | Format arguments |
Definition at line 152 of file Log.hpp.
References esengine::Info.
Referenced by init(), and shutdown().
◆ init()
| void esengine::Log::init |
( |
| ) |
|
|
static |
◆ removeSink()
| void esengine::Log::removeSink |
( |
u32 | sinkId | ) |
|
|
static |
Unregisters a log sink.
- Parameters
-
| sinkId | ID returned from addSink |
Definition at line 69 of file Log.cpp.
◆ setLevel()
| void esengine::Log::setLevel |
( |
LogLevel | level | ) |
|
|
static |
Sets the minimum log level.
- Parameters
-
| level | Messages below this level are filtered |
Definition at line 42 of file Log.cpp.
◆ shutdown()
| void esengine::Log::shutdown |
( |
| ) |
|
|
static |
Shuts down the logging system.
Definition at line 38 of file Log.cpp.
References info().
◆ trace()
template<typename... Args>
| void esengine::Log::trace |
( |
const char * | fmt, |
|
|
Args &&... | args ) |
|
inlinestatic |
Logs a trace message.
- Template Parameters
-
| Args | Format argument types |
- Parameters
-
| fmt | Format string with {} placeholders |
| args | Format arguments |
Definition at line 130 of file Log.hpp.
References esengine::Trace.
◆ warn()
template<typename... Args>
| void esengine::Log::warn |
( |
const char * | fmt, |
|
|
Args &&... | args ) |
|
inlinestatic |
Logs a warning message.
- Template Parameters
-
| Args | Format argument types |
- Parameters
-
| fmt | Format string with {} placeholders |
| args | Format arguments |
Definition at line 163 of file Log.hpp.
References esengine::Warn.
The documentation for this class was generated from the following files:
- /home/runner/work/estella/estella/src/esengine/core/Log.hpp
- /home/runner/work/estella/estella/src/esengine/core/Log.cpp