indented_logger
A logger adapter that adds an indent to the beginning of each message.
CLASS | DESCRIPTION |
---|---|
IndentedLoggerAdapter |
Logger adapter that adds an indent to the beginning of each message. |
FUNCTION | DESCRIPTION |
---|---|
get_config |
Get the loggic config. |
get_indented_logger |
Get a logger with indentation. |
setup_logging |
Configure the logging. |
Classes¶
IndentedLoggerAdapter
¶
IndentedLoggerAdapter(
logger: Logger,
extra: Optional[dict] = None,
depth: int = 2,
indent_char: str = " ",
reset: bool = False,
)
Bases: LoggerAdapter
Logger adapter that adds an indent to the beginning of each message.
PARAMETER | DESCRIPTION |
---|---|
logger
|
The logger to adapt.
TYPE:
|
extra
|
Extra values to add to the logging context. |
depth
|
The number of
TYPE:
|
indent_char
|
The character or string to use for indenting.
TYPE:
|
reset
|
TYPE:
|
METHOD | DESCRIPTION |
---|---|
dedent |
Decrease the indent level by |
indent |
Increase the indent level by |
process |
Process the message and add the indent. |
reset |
Reset the indent level to zero. |
ATTRIBUTE | DESCRIPTION |
---|---|
current_indent |
The current indent level.
TYPE:
|
indent_str |
The indent string.
TYPE:
|
Attributes¶
Functions¶
process
¶
process(
msg: Union[str, RenderableType], kwargs: Optional[MutableMapping[str, Any]]
) -> Tuple[str, MutableMapping[str, Any]]
Process the message and add the indent.
PARAMETER | DESCRIPTION |
---|---|
msg
|
The logging message. |
kwargs
|
Keyword arguments passed to the logger.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Tuple[str, MutableMapping[str, Any]]
|
A tuple containing the message and keyword arguments. |
Functions¶
get_indented_logger
¶
get_indented_logger(name: str) -> IndentedLoggerAdapter
Get a logger with indentation.