watcher#
All functions and features for logging the app
- class src.tetue_generic.watcher.WatcherConfiguration(**data)[source]#
Configuration model for the watcher component.
This class inherits from Pydantic’s BaseModel and defines the configuration parameters for logging in the watcher component.
- log_file_path#
The file path where log files will be stored.
- Type:
- src.tetue_generic.watcher.init_logging(conf_watcher)[source]#
Initializes logging configuration for the application..
- Parameters:
conf_watcher (watcher.WatcherConfiguration) – A configuration object containing
settings. (logging)
- Return type:
- Returns:
None
Note
This function modifies the global logger object from Loguru.
The ‘EXTDEBUG’ level is set to 9, between DEBUG (10) and INFO (20).
Log files are rotated when they reach 500 MB in size.
Console output is colorized for better readability.
Initialization function#
The initialization process is performed by the src.tetue_generic.watcher.init_logging()
function. This function performs the following tasks:
Procedure for the initialization process#
Removes any existing log handlers.
Adds a custom log level ‘EXTDEBUG’.
Configures file logging with rotation.
Sets up console logging with color output
Log levels#
The following log levels are available:
TRACE
EXTDEBUG
DEBUG
INFO
SUCCESS
WARNING
ERROR
CRITICAL
Two Debug Levels for Optimized Logging Granularity
Our system employs two distinct debug levels:
DEBUG: For general debugging information.
EXTDEBUG: For more detailed, cyclically queried information.
The EXTDEBUG level is used for high-frequency logging events such as repeated API requests. This prevents the standard DEBUG log from being flooded with repetitive information while still allowing for deeper insight into system behavior when needed.
Example: While DEBUG logs general process steps, EXTDEBUG records every single API request with details. This enables precise troubleshooting without compromising the readability of standard logs.