cpl_core.logging

cpl_core.logging.logger_abc

class cpl_core.logging.logger_abc.LoggerABC

Bases: abc.ABC

ABC for cpl_core.logging.logger_service.Logger

abstract debug(name: str, message: str)

Writes a debug message

name: str

Message name

message: str

Message string

abstract error(name: str, message: str, ex: Optional[Exception] = None)

Writes an error

name: str

Error name

message: str

Error message

ex: Exception

Thrown exception

abstract fatal(name: str, message: str, ex: Optional[Exception] = None)

Writes an error and ends the program

name: str

Error name

message: str

Error message

ex: Exception

Thrown exception

abstract header(string: str)

Writes a header message

string: str

String to write as header

abstract info(name: str, message: str)

Writes an information

name: str

Message name

message: str

Message string

abstract trace(name: str, message: str)

Writes a trace message

name: str

Message name

message: str

Message string

abstract warn(name: str, message: str)

Writes an warning

name: str

Message name

message: str

Message string

cpl_core.logging.logger_service

class cpl_core.logging.logger_service.Logger(logging_settings: cpl_core.logging.logging_settings.LoggingSettings, time_format: cpl_core.time.time_format_settings.TimeFormatSettings, env: cpl_core.environment.application_environment_abc.ApplicationEnvironmentABC)

Bases: cpl_core.logging.logger_abc.LoggerABC

Service for logging

create() None

Creates path tree and logfile

debug(name: str, message: str)

Writes a debug message

name: str

Message name

message: str

Message string

error(name: str, message: str, ex: Optional[Exception] = None)

Writes an error

name: str

Error name

message: str

Error message

ex: Exception

Thrown exception

fatal(name: str, message: str, ex: Optional[Exception] = None)

Writes an error and ends the program

name: str

Error name

message: str

Error message

ex: Exception

Thrown exception

header(string: str)

Writes a header message

string: str

String to write as header

info(name: str, message: str)

Writes an information

name: str

Message name

message: str

Message string

trace(name: str, message: str)

Writes a trace message

name: str

Message name

message: str

Message string

warn(name: str, message: str)

Writes an warning

name: str

Message name

message: str

Message string

cpl_core.logging.logging_level_enum

class cpl_core.logging.logging_level_enum.LoggingLevelEnum(value)

Bases: enum.Enum

An enumeration.

DEBUG = 5
ERROR = 2
FATAL = 1
INFO = 4
OFF = 0
TRACE = 6
WARN = 3

cpl_core.logging.logging_settings

class cpl_core.logging.logging_settings.LoggingSettings

Bases: cpl_core.configuration.configuration_model_abc.ConfigurationModelABC

Representation of logging settings

property console: cpl_core.logging.logging_level_enum.LoggingLevelEnum
property filename: str
from_dict(settings: dict)

Converts attributes to dict

settings: dict

property level: cpl_core.logging.logging_level_enum.LoggingLevelEnum
property path: str

cpl_core.logging.logging_settings_name_enum

class cpl_core.logging.logging_settings_name_enum.LoggingSettingsNameEnum(value)

Bases: enum.Enum

An enumeration.

console_level = 'ConsoleLogLevel'
file_level = 'FileLogLevel'
filename = 'Filename'
path = 'Path'