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¶
-
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
Caution: because logging2.Logger() caches handlers and loggers, from_dict() may not create a logger with the configuration requested. In particular, creating a logger that has the same name as an existing logger will return the existing log without considering any of the parameters provided by config. In addition, adding a handler to a logger (using logger.add_handler())) will silently fail if the name of the handler being added is the same as the name of an existing handler used by the logger.
- Parameters
config (
dict
) – dictionary of logger configurations- Returns
handlers
dict
: loggers- Return type
dict
- Raises
log.ConfigurationError – For unsupported handler types
ModuleNotFoundError – If logging2 is not installed
-
static
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.
-
__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 namelogs (
dict
, optional) – dictionary of logs to search
-