Logging Framework (log)
The log module provides structured, multi-level logging with console, file, and dual-output sinks and level filtering.
Log Levels
DEBUG(Level 0)INFO(Level 1, default)WARN(Level 2)ERROR(Level 3)
Functions
log.info(message: String)
Logs an informational message.
log.warn(message: String)
Logs a warning message.
log.error(message: String)
Logs an error message.
log.debug(message: String)
Logs a debug message (suppressed when level is INFO or above).
log.set_level(level: String)
Sets the active minimum log level ("DEBUG", "INFO", "WARN", "ERROR").
log.set_output(target: String)
Configures log output sink: "console", "file", or "both".
log.set_file(file_path: String)
Configures the log file destination.