Since version 0.18.0 rebase-helper uses standard module-level loggers.

There are also 3 loggers with a special purpose:

Logger name Purpose
rebasehelper.traceback traceback generated by unhandled exceptions
rebasehelper.summary messages forming the rebase summary
rebasehelper.report messages forming the textual rebase report (used by text output tool)

rebase-helper uses rebasehelper.logger.CustomLogger logger class which provides extra logging levels.

rebasehelper.logger.LoggerHelper class provides 3 utility methods to manage default handlers:


# use a single module and get logs from it

import logging

from rebasehelper.specfile import SpecFile

logger = logging.getLogger('rebasehelper.specfile')

spec = SpecFile('test.spec')
# run a complete rebase with default log handlers

from rebasehelper.logger import LoggerHelper
from rebasehelper.config import Config
from rebasehelper.cli import CLI
from rebasehelper.application import Application

config = Config()
cli = CLI()
exec_dir, res_dir = Application.setup(config)
# default file handlers are automatically created and removed by Application instance,
# unless disabled by passing create_logs=False
app = Application(config, exec_dir, res_dir)