PyZEAL Logging Package

Class PyZEALLogger from the package pyzeal_logging.

This module provides a facade for logging.Logger class from the standard library logging module. Any access to loggers in this project should happen only through this interface.

Authors:

  • Philipp Schuette

class pyzeal.pyzeal_logging.logger_facade.PyZEALLogger(*args, **kwargs)[source]

The logging interface used throughout the PyZEAL project.

__init__(*args, **kwargs)
critical(msg, *args)[source]

Log msg with severity CRITICAL.

Parameters:

msg (str) – Messageto log

Return type:

None

debug(msg, *args)[source]

Log msg with severity DEBUG.

Parameters:

msg (str) – Messageto log

Return type:

None

error(msg, *args)[source]

Log msg with severity ERROR.

Parameters:

msg (str) – Messageto log

Return type:

None

info(msg, *args)[source]

Log msg with severity INFO.

Parameters:

msg (str) – Messageto log

Return type:

None

isEnabledFor(level)[source]

Test if logging is enabled for level level.

Parameters:

level (int) – Level to test

Returns:

bool – If logging is enabled for level level

setLevel(level)[source]

Set the logging level to level

Parameters:

level (int) – LogLevel to set

Return type:

None

warning(msg, *args)[source]

Log msg with severity WARNING.

Parameters:

msg (str) – Messageto log

Return type:

None

Module exposing named constants for log levels.

The constants in this module just act as a facade to their counterparts in the standard library logging module.

class pyzeal.pyzeal_logging.log_levels.LogLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Named constants for log levels. Simple wrapper for the constants defined in the standard library logging module.

Authors:

  • Philipp Schuette

class pyzeal.pyzeal_logging.loggable.Loggable(*args, **kwargs)[source]

Mixin for combination with classes which support logging, in particular changing the logging level.

__init__(*args, **kwargs)
property logger: PyZEALLogger

The logger instance associated with this Loggable class. Instance creation happens upon first property access.

Returns:

the logger of this class

setLevel(level)[source]

Set the log level.

Parameters:

level (LogLevel) – the new log level

Return type:

None

Module log_manager.py of the pyzeal_logging package. This module contains the basic logging setup to be used with all PyZEAL related modules.

Authors:

  • Philipp Schuette

class pyzeal.pyzeal_logging.log_manager.LogManager[source]

This class handles basic logging functionalities to be used by PyZEAL-related modules.

static buildFileName()[source]

Build a name for a (new or existing) log file based on the PyZEAL logging naming convention.

Returns:

str – convention compliant log file name

static initLogger(logName, logLevel)[source]

Initialize a module-level logger for the module ‘modName’. Default logging level is retrieved from SettingsService. All logs are stored in a ./logs directory in a file pyzeal_<datetime.now>.log, where the date is determined at the start of every new session (upon first creation of a module logger within a session).

Parameters:

logName (str) – the name of the logger, should equal the module name

Returns:

PyZEALLogger – the (module-level) logger