|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Centralized, thread-safe logging and announcement system for Lila. More...
#include <Commentator.hpp>
Collaboration diagram for Lila::Commentator:Public Member Functions | |
| void | set_level (LogLevel level) |
| void | set_verbose (bool verbose) |
| Enables or disables verbose output (shows source location). | |
| void | announce (LogLevel level, Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Announces a log message with full control. | |
| void | trace (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs a TRACE-level message. | |
| void | debug (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs a DEBUG-level message. | |
| void | info (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs an INFO-level message. | |
| void | warn (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs a WARN-level message. | |
| void | error (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs an ERROR-level message. | |
| void | fatal (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs a FATAL-level message. | |
| Commentator (const Commentator &)=delete | |
| Commentator & | operator= (const Commentator &)=delete |
Static Public Member Functions | |
| static Commentator & | instance () |
Private Member Functions | |
| Commentator () | |
| Initializes console color support (platform-specific). | |
Static Private Member Functions | |
| static bool | initialize_console_colors () |
| static constexpr std::string_view | level_color (LogLevel level) |
| Gets the ANSI color code for a log level. | |
| static constexpr std::string_view | level_string (LogLevel level) |
| Gets the string representation of a log level. | |
| static constexpr std::string_view | emitter_string (Emitter source) |
| Gets the string representation of an emitter. | |
| static std::string_view | extract_filename (const char *path) |
| Extracts the filename from a file path. | |
Private Attributes | |
| std::mutex | m_mutex |
| LogLevel | m_min_level = LogLevel::INFO |
| bool | m_verbose = false |
| bool | m_colors_enabled |
Centralized, thread-safe logging and announcement system for Lila.
The Commentator class provides formatted, colorized, and categorized logging for all Lila subsystems. It supports log levels, verbosity, and source tagging, and is designed for both interactive and automated use.
Commentator is intended for internal use by Lila and its binaries.
Definition at line 86 of file Commentator.hpp.