Thread safe logging utility with differing levels for both console and file.
More...
#include <Logger.h>
|
| static void | SetLogLevel (const LogLevel levelIn) |
| | Sets minimum log level.
|
| |
| static void | SetLogFile (const char *path) |
| | Sets the output file.
|
| |
| template<typename... Args> |
| static void | Write (const LogLevel levelIn, Args &&... args) |
| | Writes a log message.
|
| |
Thread safe logging utility with differing levels for both console and file.
◆ SetLogFile()
| void Logger::SetLogFile |
( |
const char * |
path | ) |
|
|
static |
Sets the output file.
If a file is already opened it is closed.
- Parameters
-
| path | Path to log file, empty string disables file output |
◆ SetLogLevel()
| void Logger::SetLogLevel |
( |
const LogLevel |
levelIn | ) |
|
|
static |
Sets minimum log level.
- Parameters
-
| levelIn | Minimum log level to output |
◆ Write()
template<typename... Args>
| static void Logger::Write |
( |
const LogLevel |
levelIn, |
|
|
Args &&... |
args |
|
) |
| |
|
inlinestatic |
Writes a log message.
Outputs a message to stderr and a file if set, depending if the log level is higher than the set minimum.
- Template Parameters
-
| Args | Strings and other printable |
- Parameters
-
| levelIn | Message log level |
| args | Values to be printed separated by commas |
Usage:
logger.Write(LogLevel::INFO, "Value is: ", number);
The documentation for this class was generated from the following files:
- src/Engine/Logger.h
- src/Engine/Logger.cpp