Logging¶
logging
¶
Structured logging with Rich.
Replaces the PowerShell Write-Log function from UmeAiRTUtils.psm1. Provides dual output: colored console (via Rich) + timestamped log file.
InstallerLogger(log_file=None, total_steps=0, verbose=False)
¶
Structured logger for the installer.
Replaces the PowerShell Write-Log system with levels
-2: Raw output (no prefix) 0: Step header (yellow, with separators and step counter) 1: Main item (" - ") 2: Sub-item (" -> ") 3: Info/Debug (" [INFO] ")
Source code in src/utils/logging.py
log(message, *, level=1, style='')
¶
Log a message with the given level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
The message to display. |
required |
level
|
int
|
Indentation/formatting level (-2, 0, 1, 2, 3). |
1
|
style
|
str
|
Rich style override (e.g. "success", "error", "warning"). |
''
|
Source code in src/utils/logging.py
step(message)
¶
item(message, *, style='')
¶
sub(message, *, style='')
¶
info(message)
¶
skip_step(message)
¶
Record a skipped step — adjusts total so the counter stays accurate.
Use this instead of silently returning when a step is conditionally
skipped. The total is decremented so that subsequent step()
calls still display [Step N/M] with a correct M.
Source code in src/utils/logging.py
success(message, *, level=1)
¶
warning(message, *, level=1)
¶
error(message, *, level=1)
¶
banner(title, subtitle='', version='')
¶
Display a startup banner.
Source code in src/utils/logging.py
setup_logger(log_file=None, total_steps=0, verbose=False)
¶
Create or reconfigure the default logger.
Source code in src/utils/logging.py
get_logger()
¶
Get the default logger, creating one if needed.