A singleton that manages all logging configuration and output. More...
#include <log.h>
Public Member Functions | |
| LogManager (const LogManager &)=delete | |
| void | operator= (const LogManager &)=delete |
| void | configure (LogLevel level, const std::string &file_path, const std::set< std::string > &categories) |
| Configures the logging system. | |
| void | log (LogLevel level, absl::string_view category, absl::string_view message) |
| The primary logging function. | |
| void | SetLogLevel (LogLevel level) |
| Runtime log level control (for debug card) | |
| LogLevel | GetLogLevel () const |
| void | EnableDebugLogging () |
| Toggle debug logging on/off at runtime. | |
| void | DisableDebugLogging () |
| bool | IsDebugEnabled () const |
Static Public Member Functions | |
| static LogManager & | instance () |
Private Member Functions | |
| LogManager () | |
| ~LogManager () | |
Private Attributes | |
| std::atomic< LogLevel > | min_level_ |
| std::set< std::string > | enabled_categories_ |
| std::set< std::string > | disabled_categories_ |
| std::atomic< bool > | all_categories_enabled_ |
| std::ofstream | log_stream_ |
| std::string | log_file_path_ |
A singleton that manages all logging configuration and output.
It is designed to be configured once at application startup, typically from command-line arguments. It supports filtering by level and category, and can direct output to stderr (default) or a specified file.
|
delete |
|
private |
Definition at line 39 of file log.cc.
References log_stream_.
|
static |
Definition at line 31 of file log.cc.
References instance().
Referenced by instance(), yaze::util::logf(), yaze::util::logf(), yaze::emu::Spc700::LogInstruction(), and main().

|
delete |
| void yaze::util::LogManager::configure | ( | LogLevel | level, |
| const std::string & | file_path, | ||
| const std::set< std::string > & | categories ) |
Configures the logging system.
| level | The minimum log level to record. |
| file_path | The path to the log file. If empty, logs to stderr. |
| categories | A set of specific categories to enable. If empty, all categories are enabled. |
Definition at line 45 of file log.cc.
References all_categories_enabled_, disabled_categories_, enabled_categories_, log_file_path_, log_stream_, and min_level_.
Referenced by main().
| void yaze::util::LogManager::log | ( | LogLevel | level, |
| absl::string_view | category, | ||
| absl::string_view | message ) |
The primary logging function.
| level | The severity level of the message. |
| category | The category of the message (e.g., "Graphics", "Agent"). |
| message | The formatted log message. |
Definition at line 97 of file log.cc.
References all_categories_enabled_, disabled_categories_, enabled_categories_, yaze::util::FATAL, yaze::core::FeatureFlags::get(), yaze::core::FeatureFlags::Flags::kLogToConsole, log_stream_, and min_level_.
Referenced by yaze::util::logf(), yaze::util::logf(), and yaze::emu::Spc700::LogInstruction().

|
inline |
Runtime log level control (for debug card)
Definition at line 64 of file log.h.
References min_level_.
|
inline |
Definition at line 65 of file log.h.
References min_level_.
|
inline |
Toggle debug logging on/off at runtime.
Definition at line 70 of file log.h.
References min_level_, and yaze::util::YAZE_DEBUG.
|
inline |
Definition at line 71 of file log.h.
References yaze::util::INFO, and min_level_.
|
inline |
Definition at line 72 of file log.h.
References min_level_, and yaze::util::YAZE_DEBUG.
|
private |
Definition at line 81 of file log.h.
Referenced by configure(), DisableDebugLogging(), EnableDebugLogging(), GetLogLevel(), IsDebugEnabled(), log(), and SetLogLevel().
|
private |
Definition at line 82 of file log.h.
Referenced by configure(), and log().
|
private |
Definition at line 83 of file log.h.
Referenced by configure(), and log().
|
private |
Definition at line 84 of file log.h.
Referenced by configure(), and log().
|
private |
Definition at line 87 of file log.h.
Referenced by configure(), log(), and ~LogManager().
|
private |
Definition at line 88 of file log.h.
Referenced by configure().