2.1.1.3. wc_utils.debug_logs package

2.1.1.3.1. Submodules

2.1.1.3.2. wc_utils.debug_logs.config module

Configure debug log files.

Author:Arthur Goldberg <Arthur.Goldberg@mssm.edu>
Date:2016-09-22
Copyright:2016-2018, Karr Lab
License:MIT
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

Parameters:config (dict) – dictionary of logger configurations
Returns:handlers dict: loggers
Return type:dict
Raises:log.ConfigurationError – For unsupported handler types
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

2.1.1.3.3. wc_utils.debug_logs.core module

Debugging/info log

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

Bases: object

Manage debug logs

Create and store debug logs.

logs[source]

dictionary of logs stored by a DebugLogsManager instance

Type:dict
__str__()[source]

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.

Parameters:
  • name (str) – log name
  • logs (dict, optional) – dictionary of logs to search
setup_logs(options)[source]

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

2.1.1.3.4. Module contents