Logging
LoggingConfig
¶
Source code in python/opsml/logging/_logging.pyi
__init__(show_threads=True, log_level=LogLevel.Info, write_level=WriteLevel.Stdout, use_json=False)
¶
Logging configuration options.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
show_threads
|
bool
|
Whether to include thread information in log messages. Default is True. |
True
|
log_level
|
LogLevel
|
Log level for the logger. Default is LogLevel.Info. |
Info
|
write_level
|
WriteLevel
|
Write level for the logger. Default is WriteLevel.Stdout. |
Stdout
|
use_json
|
bool
|
Whether to write log messages in JSON format. Default is False. |
False
|
Source code in python/opsml/logging/_logging.pyi
default()
staticmethod
¶
Gets a default configuration.
show_threads: True log_level: Env or LogLevel.Info write_level: WriteLevel.Stdout use_json: False
Returns:
Name | Type | Description |
---|---|---|
LoggingConfig |
LoggingConfig
|
The default JSON configuration. |
Source code in python/opsml/logging/_logging.pyi
json_default()
staticmethod
¶
Gets a default JSON configuration.
show_threads: True log_level: Env or LogLevel.Info write_level: WriteLevel.Stdout use_json: True
Returns:
Name | Type | Description |
---|---|---|
LoggingConfig |
LoggingConfig
|
The default JSON configuration. |
Source code in python/opsml/logging/_logging.pyi
RustyLogger
¶
The Rusty Logger class to use with your python and rust-backed projects.
Source code in python/opsml/logging/_logging.pyi
debug(message, *args)
¶
Logs a debug message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The message to log. |
required |
*args
|
Additional arguments to log. |
()
|
error(message, *args)
¶
Logs an error message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The message to log. |
required |
*args
|
Additional arguments to log. |
()
|
get_logger(config=None)
staticmethod
¶
Gets the logger instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
LoggingConfig
|
The configuration to use for the logger. |
None
|
Returns:
Name | Type | Description |
---|---|---|
RustyLogger |
RustyLogger
|
The logger instance. |
Source code in python/opsml/logging/_logging.pyi
info(message, *args)
¶
Logs an info message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The message to log. |
required |
*args
|
Additional arguments to log. |
()
|
setup_logging(config=None)
staticmethod
¶
Sets up the logger with the given configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
LoggingConfig
|
The configuration to use for the logger. |
None
|
trace(message, *args)
¶
Logs a trace message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The message to log. |
required |
*args
|
Additional arguments to log. |
()
|
warn(message, *args)
¶
Logs a warning message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The message to log. |
required |
*args
|
Additional arguments to log. |
()
|