Logging
duho.logging
TRACE
module-attribute
VERBOSE_HELP = ''
module-attribute
VERBOSE_LEVELS = {}
module-attribute
__all__ = ['add_logging_level', 'DefaultFormatter', 'VERBOSE_LEVELS', 'VERBOSE_HELP', 'parse_loglevels', 'init_stderr_logging', 'initverbose']
module-attribute
DefaultFormatter(fmt='%(asctime)s | %(levelname)8s | %(name)s: %(message)s', datefmt=None, style='%', validate=True)
Bases: Formatter
Log formatter with colored output.
Source code in src/duho/logging.py
80 81 82 83 84 85 86 87 88 | |
COLORS = {_logging.DEBUG: _asicode(34), _logging.INFO: _asicode(32), _logging.WARNING: _asicode(33), _logging.ERROR: _asicode(31), _logging.CRITICAL: _asicode(31, 47)}
class-attribute
instance-attribute
RESET_ALL = _asicode(0)
class-attribute
instance-attribute
format(record)
Source code in src/duho/logging.py
90 91 92 93 94 95 96 97 | |
__getattr__(name)
Source code in src/duho/logging.py
23 24 | |
add_logging_level(name, level, force=False, color=None)
Register a custom log level.
Source code in src/duho/logging.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
init_stderr_logging(name=None, level=None)
Initialize logging to stderr with color support.
Source code in src/duho/logging.py
142 143 144 145 146 147 148 149 150 151 | |
initverbose()
Initialize verbose level mappings.
Source code in src/duho/logging.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
parse_loglevels(text, itemdivider=',', valkey_separator=':')
Parse a log level specification string.
Source code in src/duho/logging.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |