|
MetaImGUI 1.0.0
ImGui Application Template for C++20
|
Simple logging system with file and console output. More...
#include <Logger.h>
Public Member Functions | |
| Logger (const Logger &)=delete | |
| Logger & | operator= (const Logger &)=delete |
| Logger (Logger &&)=delete | |
| Logger & | operator= (Logger &&)=delete |
| void | Initialize (const std::filesystem::path &logFilePath="", LogLevel minLevel=LogLevel::Info) |
| Initialize logger with optional log file. | |
| void | Shutdown () |
| Shutdown logger and flush buffers. | |
| void | SetLevel (LogLevel level) |
| Set minimum log level. | |
| LogLevel | GetLevel () const |
| Get current log level. | |
| void | SetConsoleOutput (bool enable) |
| Enable/disable console output. | |
| void | SetFileOutput (bool enable) |
| Enable/disable file output. | |
| void | Flush () |
| Flush log buffers. | |
| std::filesystem::path | GetLogFilePath () const |
| Get log file path. | |
| template<typename... Args> | |
| void | Debug (std::string_view format, Args &&... args) |
| template<typename... Args> | |
| void | Info (std::string_view format, Args &&... args) |
| template<typename... Args> | |
| void | Warning (std::string_view format, Args &&... args) |
| template<typename... Args> | |
| void | Error (std::string_view format, Args &&... args) |
| template<typename... Args> | |
| void | Fatal (std::string_view format, Args &&... args) |
| void | Debug (std::string_view message) |
| void | Info (std::string_view message) |
| void | Warning (std::string_view message) |
| void | Error (std::string_view message) |
| void | Fatal (std::string_view message) |
Static Public Member Functions | |
| static Logger & | Instance () |
| Get singleton instance. | |
Simple logging system with file and console output.
Logger provides thread-safe logging with configurable severity levels, timestamps, and output to both console and file.
Usage:
|
delete |
|
delete |
|
inline |
Definition at line 115 of file Logger.h.
References MetaImGUI::Debug.
|
inline |
Definition at line 140 of file Logger.h.
References MetaImGUI::Debug.
|
inline |
Definition at line 130 of file Logger.h.
References MetaImGUI::Error.
|
inline |
Definition at line 149 of file Logger.h.
References MetaImGUI::Error.
|
inline |
Definition at line 135 of file Logger.h.
References MetaImGUI::Fatal.
|
inline |
Definition at line 152 of file Logger.h.
References MetaImGUI::Fatal.
| void MetaImGUI::Logger::Flush | ( | ) |
Flush log buffers.
Definition at line 101 of file Logger.cpp.
| LogLevel MetaImGUI::Logger::GetLevel | ( | ) | const |
Get current log level.
Definition at line 86 of file Logger.cpp.
| std::filesystem::path MetaImGUI::Logger::GetLogFilePath | ( | ) | const |
Get log file path.
Definition at line 110 of file Logger.cpp.
|
inline |
Definition at line 120 of file Logger.h.
References MetaImGUI::Info.
|
inline |
Definition at line 143 of file Logger.h.
References MetaImGUI::Info.
| void MetaImGUI::Logger::Initialize | ( | const std::filesystem::path & | logFilePath = "", |
| LogLevel | minLevel = LogLevel::Info |
||
| ) |
Initialize logger with optional log file.
| logFilePath | Path to log file (empty to disable file logging) |
| minLevel | Minimum log level to output |
Definition at line 39 of file Logger.cpp.
Referenced by MetaImGUI::Application::Initialize().
|
static |
Get singleton instance.
Definition at line 34 of file Logger.cpp.
Referenced by MetaImGUI::Application::Initialize(), and MetaImGUI::Application::Shutdown().
| void MetaImGUI::Logger::SetConsoleOutput | ( | bool | enable | ) |
Enable/disable console output.
Definition at line 91 of file Logger.cpp.
| void MetaImGUI::Logger::SetFileOutput | ( | bool | enable | ) |
Enable/disable file output.
Definition at line 96 of file Logger.cpp.
| void MetaImGUI::Logger::SetLevel | ( | LogLevel | level | ) |
Set minimum log level.
Definition at line 81 of file Logger.cpp.
| void MetaImGUI::Logger::Shutdown | ( | ) |
Shutdown logger and flush buffers.
Definition at line 72 of file Logger.cpp.
Referenced by MetaImGUI::Application::Shutdown().
|
inline |
Definition at line 125 of file Logger.h.
References MetaImGUI::Warning.
|
inline |
Definition at line 146 of file Logger.h.
References MetaImGUI::Warning.