|
R-Type
Distributed multiplayer game engine in C++
|
Thread-safe logging system with timestamps and source location. More...
#include <Logger.hpp>

Static Public Member Functions | |
| static void | setLevel (Level level) |
| Set minimum log level (messages below this level are ignored) | |
| static void | setColors (bool enable) |
| Enable or disable colored output. | |
| static void | log (Level level, const char *file, int line, const std::string &message) |
| Log a message with source location. | |
| template<typename... Args> | |
| static void | logf (Level level, const char *file, int line, Args &&...args) |
| Log a message with formatted arguments. | |
Static Private Member Functions | |
| static std::string | getBasename (const char *filePath) |
| Extract basename from file path. | |
| static std::string | getTimestamp () |
| Get current timestamp with milliseconds. | |
| static const char * | getLevelColor (Level level) |
| Get color for log level. | |
| static const char * | getLevelString (Level level) |
| Get string representation of log level. | |
Static Private Attributes | |
| static std::mutex | _mutex |
| static Level | _minLevel = Level::DEBUG |
| static bool | _enableColors = true |
Thread-safe logging system with timestamps and source location.
Definition at line 50 of file Logger.hpp.
|
inlinestaticprivate |
|
inlinestaticprivate |
Get color for log level.
Definition at line 89 of file Logger.hpp.
References _enableColors, logger::Colors::BOLD_RED, logger::CRITICAL, logger::DEBUG, logger::ERROR, logger::INFO, logger::Colors::LOG_GRAY, logger::Colors::LOG_GREEN, logger::Colors::LOG_RED, logger::Colors::LOG_YELLOW, logger::Colors::RESET, and logger::WARNING.
Referenced by log().
|
inlinestaticprivate |
Get string representation of log level.
Definition at line 112 of file Logger.hpp.
References logger::CRITICAL, logger::DEBUG, logger::ERROR, logger::INFO, and logger::WARNING.
Referenced by log().
|
inlinestaticprivate |
Get current timestamp with milliseconds.
Definition at line 68 of file Logger.hpp.
Referenced by log().
|
inlinestatic |
Log a message with source location.
Definition at line 143 of file Logger.hpp.
References _enableColors, _minLevel, _mutex, logger::Colors::BOLD_WHITE, logger::Colors::CYAN, getBasename(), getLevelColor(), getLevelString(), getTimestamp(), and logger::Colors::RESET.
Referenced by logf().

|
inlinestatic |
Log a message with formatted arguments.
Definition at line 167 of file Logger.hpp.
References _minLevel, and log().

|
inlinestatic |
Enable or disable colored output.
Definition at line 138 of file Logger.hpp.
References _enableColors.
|
inlinestatic |
Set minimum log level (messages below this level are ignored)
Definition at line 133 of file Logger.hpp.
References _minLevel.
|
inlinestaticprivate |
Definition at line 54 of file Logger.hpp.
Referenced by getLevelColor(), log(), and setColors().
|
inlinestaticprivate |
Definition at line 53 of file Logger.hpp.
Referenced by log(), logf(), and setLevel().
|
inlinestaticprivate |
Definition at line 52 of file Logger.hpp.
Referenced by log().