|
MayaFlux 0.4.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 | announce (LogLevel level, Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Announces a log message with full control. | |
| Commentator (const Commentator &)=delete | |
| void | debug (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs a DEBUG-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. | |
| void | info (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs an INFO-level message. | |
| Commentator & | operator= (const Commentator &)=delete |
| void | set_level (LogLevel level) |
| void | set_verbose (bool verbose) |
| Enables or disables verbose output (shows source location). | |
| void | trace (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs a TRACE-level message. | |
| void | warn (Emitter source, std::string_view message, std::source_location location=std::source_location::current()) |
| Logs a WARN-level message. | |
Static Public Member Functions | |
| static Commentator & | instance () |
Private Member Functions | |
| Commentator () | |
| Initializes console color support (platform-specific). | |
Static Private Member Functions | |
| 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. | |
| 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. | |
Private Attributes | |
| bool | m_colors_enabled |
| LogLevel | m_min_level = LogLevel::INFO |
| std::mutex | m_mutex |
| bool | m_verbose = false |
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.