Skip to main content
Version: 2.2.2-1

Logging

RimTUB uses Python's built-in logging module for logging.

Access to the logger is available via mod.logger.

Levels​

By default, the logging level for modules is set to DEBUG. The user can change the default logging level in the configuration file (parameter DEFAULT_MODULE_LOGGING_LEVEL).

If needed, the level can be manually changed in a module:

SomeModule/__init__.py
from utils import *
import logging

async def main(app: Client, mod: Module):

mod.logger.setLevel(logging.INFO)

Examples​

mod.logger.debug('test')  
mod.logger.info('test')
mod.logger.warning('test')
mod.logger.error('test')


2025-03-29 08:51:38 RimTUB [0] [ExampleModule] DEBUG: test
2025-03-29 08:51:38 RimTUB [0] [ExampleModule] INFO: test
2025-03-29 08:51:38 RimTUB [0] [ExampleModule] WARNING: test
2025-03-29 08:51:38 RimTUB [0] [ExampleModule] ERROR: test