Back to bricks list
Introduction
Technical Documentation
Other Classes
Logger
Version

Logger

Logger class

It logs into the console and in the log file

Attributes

level: Literal

Functions

__INIT__

Create the Gencovery logger, it logs into the console and into a file

Parameters:
NameTypeDefault valueDescription
log_dirstr
levelLiteral INFO Level of the logs to show, defaults to "info" error | info | debug, optional
scenario_idstr
CHECK_LOG_LEVEL - @classmethod
Parameters:
NameTypeDefault valueDescription
log_levelstr
Return type:
Literal
CLEAR_LOGGER - @classmethod

Clear the logger

DATE_TO_FILE_NAME - @classmethod

Convert a date to a file name. If the date is the current date the file name is 'log' Otherwise the file name is in the format 'log.YYYY-MM-DD'

Parameters:
NameTypeDefault valueDescription
datedatetime Date to convert
Return type:
str
DEBUG - @classmethod
Parameters:
NameTypeDefault valueDescription
messagestr
ERROR - @classmethod
Parameters:
NameTypeDefault valueDescription
messagestr
FILE_NAME_TO_DATE - @classmethod

Convert a file name to a date. If the file name is 'log' the current date is returned Otherwise file name must be in the format 'log.YYYY-MM-DD'

Parameters:
NameTypeDefault valueDescription
file_namestr File name to convert
Return type:
datetime
GET_DATE - @classmethod
Return type:
str
GET_FILE_PATH - @classmethod
Return type:
str
INFO - @classmethod
Parameters:
NameTypeDefault valueDescription
messagestr
LOG_EXCEPTION_STACK_TRACE - @classmethod
Parameters:
NameTypeDefault valueDescription
exceptionException
PROGRESS - @classmethod
Parameters:
NameTypeDefault valueDescription
messagestr
WARNING - @classmethod
Parameters:
NameTypeDefault valueDescription
messagestr