fake-api-server.ci.surveillance.log¶
This module provides functionality for initializing and configuring logging settings.
It allows customization of logging formats, date/time formats, and logging levels.
The module also ensures compatibility for Python versions below 3.9 by handling the
absence of the encoding
parameter in the logging.basicConfig
function.
init_logger_config(formatter='', datefmt='', level=logging.INFO, encoding='utf-8')
¶
Configures the logger with the specified settings and initializes the logging system.
Allows setting the format, date format, logging level, and encoding for the logs.
If the logging level is DEBUG, it overrides the formatter
and datefmt
with predefined
debug-level configurations. Compatibility for Python versions below 3.9 is handled
by omitting the encoding parameter in those cases.
PARAMETER | DESCRIPTION |
---|---|
formatter
|
Specifies the log message format. Defaults to an empty string.
TYPE:
|
datefmt
|
Specifies the date/time format for log messages. Defaults to an empty string.
TYPE:
|
level
|
Sets the logging level (e.g., DEBUG, INFO, WARNING). Defaults to logging.INFO.
TYPE:
|
encoding
|
Encoding used for log messages. Defaults to "utf-8". This parameter is applied only for Python versions 3.9 and above.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
None
|
This function does not return a value. |