3. log — Logging facilities

python-brisa provides a logging module with a colored logging feature.

The logging module is configured by the default manager described on config under the default brisa section.

The two main parameters that can be adjusted are:

  • brisa.logging, determines the highest logging level (ERROR, INFO, CRITICAL, DEBUG, WARNING)
  • brisa.logging_output, which determines where the log should appear (commonly used values are stdout, file - located at ~/brisa.log).

These parameters can be modified through the config module or using the brisa-conf tool. Try brisa-conf -h for usage.

3.1. Global Logger

This module provides a global (or root) logger, which can be used simply by:

from brisa.core import log

log.debug('My debug message.')
log.error('My error message.')
log.info('My info message.')

3.2. Loggers

For retrieving loggers other than the global/root one, use the log.getLogger() function as follows:

from brisa.core import log

mylogger = log.getLogger('my_logger')

Table Of Contents

Previous topic

2. config — Configuration facilities

Next topic

4. threaded_call — Threaded function calls

This Page