formatters
CiFormatter
¶
Bases: Formatter
A formatter that takes into account a CI environment.
We can still use
Source code in m/log/formatters.py
__init__(datefmt='%I:%M:%S %p - %b %d, %Y')
¶
Initialize by optionally providing a date formatter.
See https://docs.python.org/3/library/time.html#time.strftime for more info on how to format the date.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
datefmt |
str
|
The date format to use. |
'%I:%M:%S %p - %b %d, %Y'
|
Source code in m/log/formatters.py
format(record)
¶
Format a record as based on the CI environment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record |
LogRecord
|
The logRecord to format. |
required |
Returns:
Type | Description |
---|---|
str
|
A formatted string. |
Source code in m/log/formatters.py
JsonFormatter
¶
Bases: Formatter
Format each record as JSON data in one single line.
Source code in m/log/formatters.py
format(record)
¶
Format a record as json.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record |
LogRecord
|
The logRecord to format. |
required |
Returns:
Type | Description |
---|---|
str
|
A formatted string. |