Skip to content

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.

Type: bool

Type: LogLevel

Type: bool

Type: char

Type: LogBuffer

Type: void *

Type: bool

Type: size_t

Type: uint64_t

Type: bool

Type: ams::os::Mutex

Type: constexpr uint64_t

void Logger()
void ~Logger()
void Logger(const&)

Parameters:

  • param (const&)
& 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 *)
bool is_enabled()

Check if logging is enabled.

Returns: bool

LogLevel get_level()

Get current log level.

Returns: LogLevel

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.

const& get_buffer()

Get access to the log buffer for overlay display.

Reference to internal log bufferreturn

Returns: const&

& get_buffer()

Get mutable access to log buffer.

Reference to internal log bufferreturn

Returns: &

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).

void output_message(const char * message)

Parameters:

  • message (const char *)
void open_file()
void close_file()