reviewbot.utils.log¶
Utility functions for loggers.
New in version 3.0.
Functions
|
Return a logger with the given name. |
Return a root logger for Review Bot. |
- get_logger(name, is_task_logger=True)[source]¶
Return a logger with the given name.
The logger will by default be constructed as a task logger. This will ensure it contains additional information on the current task name and task ID, if running in a task. If executed outside of a task, the name name and ID will be replaced with
???
by Celery.Task logging should be turned off only when we know for sure that the code isn’t going to be running in a task.
New in version 3.0.
- Parameters:
name (
str
) – The name shown in the log line. This is expected to be a module name.is_task_logger (
bool
, optional) – Whether to construct a task logger.
- Returns:
The new (or existing) logger for the given name.
- Return type:
logging.Logger