topmark.core.logging¶
Custom TopMark logging with TRACE logging.
This module extends Python's standard logging with TopMark-specific features, including a custom
TRACE level (below DEBUG) and a specialized logger class.
Logging output is intentionally plain text (no ANSI styling). Presentation and color concerns belong in the CLI layer.
TopmarkLogger ¶
Bases: Logger
Custom logger class for TopMark with support for a TRACE log level below DEBUG.
trace ¶
Log 'msg % args' with severity 'TRACE'.
This method logs a message with the custom TRACE level, which is lower than DEBUG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg
|
object
|
The message to be logged. |
required |
*args
|
object
|
Variable length argument list for the message. |
()
|
extra
|
Mapping[str, object] | None
|
Optional dictionary of extra information to pass to the logger. |
None
|
Source code in src/topmark/core/logging.py
TopmarkFormatter ¶
Bases: Formatter
Plain-text formatter for TopMark logs.
resolve_env_log_level ¶
Return a logging level from environment or None if unset.
Honors TOPMARK_LOG_LEVEL (e.g., "TRACE", "DEBUG", "INFO", numeric "10").
Source code in src/topmark/core/logging.py
setup_logging ¶
Configure the root logger with a specified log level (and plain-text output).
If level is None, environment variables are consulted via
resolve_env_log_level.
Default is CRITICAL when unspecified.
Source code in src/topmark/core/logging.py
get_logger ¶
Retrieve a TopmarkLogger instance with the specified name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the logger. |
required |
Returns:
| Type | Description |
|---|---|
TopmarkLogger
|
A TopmarkLogger instance. |