wc_utils.debug_logs package Submodules wc_utils.debug_logs.config module

exception wc_utils.debug_logs.config.ConfigurationError[source]

Bases: Exception

An error in a logging configuration

class wc_utils.debug_logs.config.LoggerConfigurator[source]

Bases: object

A class with static methods that configures log files.

static from_dict(config)[source]

Create and configure logs from a dictionary which describes their configuration


config (dict) – dictionary of logger configurations


handlers dict: loggers

Return type:


  • log.ConfigurationError – For unsupported handler types
  • ModuleNotFoundError – If logging2 is not installed
static from_yaml(config_path)[source]

Create and configure logs from a YAML file which describes their configuration

Deprecated in favor of ConfigObj

Returns:handlers dict: loggers
Return type:dict
Parameters:config_path (str) – path to configuration file written in YAML wc_utils.debug_logs.core module

Debugging/info log

Author:Jonathan Karr <karr@mssm.edu>
Copyright:2016-2018, Karr Lab
class wc_utils.debug_logs.core.DebugLogsManager[source]

Bases: object

Manage debug logs

Create and store debug logs.


dictionary of logs stored by a DebugLogsManager instance


Return string representation of this DebugLogsManager’s logs

Returns:the name, level, template and filename (if used) for each log
Return type:str
get_log(name, logs=None)[source]

Returns log with name name. Optionally, search for log in dict logs.

  • name (str) – log name
  • logs (dict, optional) – dictionary of logs to search

Configure and create a log from a log description in a nested dict.

Typically the log description is obtained by reading a .cfg file with ConfigObj.

Parameters:options (dict) – a configuration
Returns:this DebugLogsManager
Return type:DebugLogsManager Module contents