Skip to content

Logging config

SectionAwareFormatter

Bases: Formatter

Avoid to print headers for section and sub sections logs

format

format(record: LogRecord) -> str

Format the log record

Parameters:

Name Type Description Default
record LogRecord

The log record to format

required

Returns:

Name Type Description
str str

The formatted log record

configure_logging

configure_logging() -> StringIO

Configure logging

Returns:

Name Type Description
StringIO StringIO

The log stream for further use

log_section

log_section(title: str) -> None

Create a section in the log

Parameters:

Name Type Description Default
title str

Title of the section

required

log_sub_section

log_sub_section(title: str) -> None

Create a sub section in the log

Parameters:

Name Type Description Default
title str

Title of the section

required