|
MetaImGUI 1.0.0
ImGui Application Template for C++20
|
Thread-safe logger with file and console output. More...
#include <Logger.h>
Classes | |
| struct | Impl |
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) |
| void | Shutdown () |
| void | SetLevel (LogLevel level) noexcept |
| LogLevel | GetLevel () const noexcept |
| void | SetConsoleOutput (bool enable) |
| void | SetFileOutput (bool enable) |
| void | Flush () |
| std::filesystem::path | GetLogFilePath () const |
| template<typename... Args> | |
| void | Debug (std::format_string< Args... > fmt, Args... args) |
| template<typename... Args> | |
| void | Info (std::format_string< Args... > fmt, Args... args) |
| template<typename... Args> | |
| void | Warning (std::format_string< Args... > fmt, Args... args) |
| template<typename... Args> | |
| void | Error (std::format_string< Args... > fmt, Args... args) |
| template<typename... Args> | |
| void | Fatal (std::format_string< Args... > fmt, 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 () |
Thread-safe logger with file and console output.
Templated entry points format with std::vformat (C++20). The minimum-level filter is checked through an atomic so the early-out path is lock-free.
Usage:
|
delete |
|
delete |
|
inline |
Definition at line 84 of file Logger.h.
References MetaImGUI::Debug, and GetLevel().
|
inline |
Definition at line 119 of file Logger.h.
References MetaImGUI::Debug, and GetLevel().
|
inline |
Definition at line 105 of file Logger.h.
References MetaImGUI::Error, and GetLevel().
|
inline |
Definition at line 134 of file Logger.h.
References MetaImGUI::Error, and GetLevel().
|
inline |
Definition at line 112 of file Logger.h.
References MetaImGUI::Fatal, and GetLevel().
|
inline |
Definition at line 139 of file Logger.h.
References MetaImGUI::Fatal, and GetLevel().
| void MetaImGUI::Logger::Flush | ( | ) |
Definition at line 156 of file Logger.cpp.
|
inlinenoexcept |
| std::filesystem::path MetaImGUI::Logger::GetLogFilePath | ( | ) | const |
Definition at line 165 of file Logger.cpp.
|
inline |
Definition at line 91 of file Logger.h.
References GetLevel(), and MetaImGUI::Info.
|
inline |
Definition at line 124 of file Logger.h.
References GetLevel(), and MetaImGUI::Info.
| void MetaImGUI::Logger::Initialize | ( | const std::filesystem::path & | logFilePath, |
| LogLevel | minLevel = LogLevel::Info |
||
| ) |
Definition at line 105 of file Logger.cpp.
Referenced by MetaImGUI::Application::Initialize().
|
static |
Definition at line 100 of file Logger.cpp.
Referenced by MetaImGUI::Application::Initialize(), and MetaImGUI::Application::Shutdown().
| void MetaImGUI::Logger::SetConsoleOutput | ( | bool | enable | ) |
Definition at line 146 of file Logger.cpp.
| void MetaImGUI::Logger::SetFileOutput | ( | bool | enable | ) |
Definition at line 151 of file Logger.cpp.
|
inlinenoexcept |
| void MetaImGUI::Logger::Shutdown | ( | ) |
Definition at line 137 of file Logger.cpp.
Referenced by MetaImGUI::Application::Shutdown().
|
inline |
Definition at line 98 of file Logger.h.
References GetLevel(), and MetaImGUI::Warning.
|
inline |
Definition at line 129 of file Logger.h.
References GetLevel(), and MetaImGUI::Warning.