DDraceNetwork Docs
|
Classes | |
class | CLogMessage |
class | CFutureLogger |
class | CLogScope |
Functions | |
void | log_log (LEVEL level, const char *sys, const char *fmt,...) |
void | log_log_color (LEVEL level, LOG_COLOR color, const char *sys, const char *fmt,...) |
void | log_log_v (LEVEL level, const char *sys, const char *fmt, va_list args) |
void | log_log_color_v (LEVEL level, LOG_COLOR color, const char *sys, const char *fmt, va_list args) |
void | log_set_global_logger (ILogger *logger) |
void | log_set_global_logger_default () |
void | log_global_logger_finish () |
ILogger * | log_get_scope_logger () |
void | log_set_scope_logger (ILogger *logger) |
std::unique_ptr< ILogger > | log_logger_android () |
std::unique_ptr< ILogger > | log_logger_collection (std::vector< std::shared_ptr< ILogger > > &&vpLoggers) |
std::unique_ptr< ILogger > | log_logger_file (IOHANDLE file) |
std::unique_ptr< ILogger > | log_logger_stdout () |
std::unique_ptr< ILogger > | log_logger_windows_debugger () |
std::unique_ptr< ILogger > | log_logger_noop () |
Methods for outputting log messages and way of handling them.
ILogger * log_get_scope_logger | ( | ) |
Get the logger active in the current scope. This might be the global default logger or some other logger set via log_set_scope_logger
.
void log_global_logger_finish | ( | ) |
Notify global loggers of impending abnormal exit.
This function is automatically called on normal exit. It notifies the global logger of the impending shutdown via GlobalFinish
, the logger is supposed to flush its buffers and shut down.
Don't call this except right before an abnormal exit.
void log_log | ( | LEVEL | level, |
const char * | sys, | ||
const char * | fmt, | ||
... | |||
) |
Prints a log message.
level | Severity of the log message. |
sys | A string that describes what system the message belongs to. |
fmt | A printf styled format string. |
Prints a log message with a given color.
level | Severity of the log message. |
color | Requested color for the log message output. |
sys | A string that describes what system the message belongs to. |
fmt | A printf styled format string. |
void log_log_color_v | ( | LEVEL | level, |
LOG_COLOR | color, | ||
const char * | sys, | ||
const char * | fmt, | ||
va_list | args | ||
) |
Same as log_log_color
, but takes a va_list
instead.
level | Severity of the log message. |
color | Requested color for the log message output. |
sys | A string that describes what system the message belongs to. |
fmt | A printf styled format string. |
args | The variable argument list. |
void log_log_v | ( | LEVEL | level, |
const char * | sys, | ||
const char * | fmt, | ||
va_list | args | ||
) |
Same as log_log
, but takes a va_list
instead.
level | Severity of the log message. |
sys | A string that describes what system the message belongs to. |
fmt | A printf styled format string. |
args | The variable argument list. |
std::unique_ptr< ILogger > log_logger_android | ( | ) |
Logger for sending logs to the Android system log.
Should only be called when targeting the Android platform.
std::unique_ptr< ILogger > log_logger_collection | ( | std::vector< std::shared_ptr< ILogger > > && | vpLoggers | ) |
Logger combining a vector of other loggers.
Logger for writing logs to the given file.
file | File to write to, must be opened for writing. |
std::unique_ptr< ILogger > log_logger_noop | ( | ) |
Logger which discards all logs.
std::unique_ptr< ILogger > log_logger_stdout | ( | ) |
Logger for writing logs to the standard output (stdout).
std::unique_ptr< ILogger > log_logger_windows_debugger | ( | ) |
Logger for sending logs to the debugger on Windows via OutputDebugStringW
.
Should only be called when targeting the Windows platform.
void log_set_global_logger | ( | ILogger * | logger | ) |
Registers a logger instance as the default logger for all current and future threads. It will only be used if no thread-local logger is set via log_set_scope_logger
.
This function can only be called once. The passed logger instance will never be freed.
logger | The global logger default. |
void log_set_global_logger_default | ( | ) |
Registers a sane default as the default logger for all current and future threads.
This is logging to stdout on most platforms and to the system log on Android.