Adapter logging
_get_default_log_level(default_level=logging.INFO)
¶
Retrieves the default logging level from a config file, or returns a default value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
default_level
|
int
|
The default logging level if not set in the config file. Defaults to logging.INFO. |
INFO
|
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The default logging level. |
Source code in lib/python/src/aria/ops/adapter_logging.py
_set_log_levels()
¶
Sets the logging levels for each logger as defined in a config file.
Source code in lib/python/src/aria/ops/adapter_logging.py
getLogger(name)
¶
A convenience function to get a logger with a specific name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the logger. |
required |
Returns:
Type | Description |
---|---|
Logger
|
logging.Logger: The requested logger. |
Source code in lib/python/src/aria/ops/adapter_logging.py
rotate()
¶
Rotates the current adapter logs to their backups (e.g., adapter.log
to
adapter.log.1
) and starts logging to the new adapter.log file.
setup_logging(filename, file_count=5, max_size=0)
¶
Sets up logging using the given parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
The name of the file to log to. |
required |
file_count
|
int
|
The total number of files to retain. Defaults to 5. |
5
|
max_size
|
int
|
The maximum size in bytes of each file before the file automatically rotates to a new one. Defaults to '0', which will do no automatic rotation. Requires calling the 'rotate()' function manually to ensure logs do not become too large. |
0
|