ryu_ldn::debug::Logger
ryu_ldn::debug::Logger
Section titled “ryu_ldn::debug::Logger”Main logger class.
Handles log message formatting, filtering by level, and output to console and/or file. Thread-safe for concurrent logging.
Members
Section titled “Members”m_enabled
Section titled “m_enabled”Type: bool
m_level
Section titled “m_level”Type: LogLevel
m_log_to_file
Section titled “m_log_to_file”Type: bool
m_log_path
Section titled “m_log_path”Type: char
m_buffer
Section titled “m_buffer”Type: LogBuffer
m_file
Section titled “m_file”Type: void *
m_file_open
Section titled “m_file_open”Type: bool
m_file_offset
Section titled “m_file_offset”Type: size_t
m_last_write_tick
Section titled “m_last_write_tick”Type: uint64_t
m_header_written
Section titled “m_header_written”Type: bool
m_mutex
Section titled “m_mutex”Type: ams::os::Mutex
Members
Section titled “Members”FILE_IDLE_TIMEOUT_NS
Section titled “FILE_IDLE_TIMEOUT_NS”Type: constexpr uint64_t
Methods
Section titled “Methods”Logger
Section titled “Logger”void Logger()~Logger
Section titled “~Logger”void ~Logger()Logger
Section titled “Logger”void Logger(const&)Parameters:
param(const&)
operator=
Section titled “operator=”& operator=(const&)Parameters:
param(const&)
Returns: &
void init(const& config, const char * log_path)Initialize logger with configuration.
configDebug configuration from config.inilog_pathOptional custom log file path (default: DEFAULT_LOG_PATH)param
Parameters:
config(const&)log_path(const char *)
is_enabled
Section titled “is_enabled”bool is_enabled()Check if logging is enabled.
Returns: bool
get_level
Section titled “get_level”LogLevel get_level()Get current log level.
Returns: LogLevel
should_log
Section titled “should_log”bool should_log(LogLevel level)Check if a message at given level should be logged.
levelLog level to checkparamtrue if message should be loggedreturn
Parameters:
level(LogLevel)
Returns: bool
void log(LogLevel level, const char * format, ...)Log a message.
levelLog levelformatprintf-style format string…Format argumentsparam
Parameters:
level(LogLevel)format(const char *)param(...)
void log_v(LogLevel level, const char * format, va_list args)Log a message with va_list.
levelLog levelformatprintf-style format stringargsFormat argumentsparam
Parameters:
level(LogLevel)format(const char *)args(va_list)
void flush()Flush any buffered output to file.
get_buffer
Section titled “get_buffer”const& get_buffer()Get access to the log buffer for overlay display.
Reference to internal log bufferreturn
Returns: const&
get_buffer
Section titled “get_buffer”& get_buffer()Get mutable access to log buffer.
Reference to internal log bufferreturn
Returns: &
check_idle_timeout
Section titled “check_idle_timeout”void check_idle_timeout()Check and close file if idle timeout expired.
Should be called periodically. Closes the file if no writes occurred within the timeout period (5 seconds).
Methods
Section titled “Methods”output_message
Section titled “output_message”void output_message(const char * message)Parameters:
message(const char *)
open_file
Section titled “open_file”void open_file()close_file
Section titled “close_file”void close_file()