logger
This module defines the logging interface for storing system logs.
__all__ = ['logger', 'init', 'default_log_filter']
module-attribute
default_log_filter = None
module-attribute
module_names = [name for (_, name, _) in pkgutil.iter_modules(['roc'])]
module-attribute
DebugModuleLevel
Bases: BaseModel
A Pydantic model for storing the logging level. Used primarily for setting per-module logging levels.
Source code in roc/logger.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
log_level = Field(pattern='TRACE|DEBUG|INFO|SUCCESS|WARNING|ERROR|CRITICAL')
class-attribute
instance-attribute
module_name
instance-attribute
validate_module_name(name)
classmethod
Source code in roc/logger.py
25 26 27 28 29 30 31 32 |
|
LogFilter
A Callable filter that determines if the loguru record should be logged or not.
Source code in roc/logger.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
level = level or settings.log_level
instance-attribute
level_num = logger.level(self.level).no
instance-attribute
module_levels = {mod_lvl.module_name: mod_lvl.log_levelfor mod_lvl in mod_list}
instance-attribute
__call__(record)
Source code in roc/logger.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
__init__(*, level=None, log_modules=None, enabled=True, use_module_settings=True)
Source code in roc/logger.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
parse_module_str(s)
classmethod
Source code in roc/logger.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
init()
Initializes the logging module. Installs the filter, fetches the settings, etc.
Source code in roc/logger.py
96 97 98 99 100 101 102 103 104 105 106 |
|