This document describes the current stable version of Celery (4.3). For development docs, go here.
celery.utils.log
¶
Logging utilities.
-
class
celery.utils.log.
ColorFormatter
(fmt=None, use_color=True)[source]¶ Logging formatter that adds colors based on severity.
-
COLORS
= {u'black': <bound method colored.black of u''>, u'blue': <bound method colored.blue of u''>, u'cyan': <bound method colored.cyan of u''>, u'green': <bound method colored.green of u''>, u'magenta': <bound method colored.magenta of u''>, u'red': <bound method colored.red of u''>, u'white': <bound method colored.white of u''>, u'yellow': <bound method colored.yellow of u''>}¶ Loglevel -> Color mapping.
-
colors
= {u'CRITICAL': <bound method colored.magenta of u''>, u'DEBUG': <bound method colored.blue of u''>, u'ERROR': <bound method colored.red of u''>, u'WARNING': <bound method colored.yellow of u''>}¶
-
format
(record)[source]¶ Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
-
-
class
celery.utils.log.
LoggingProxy
(logger, loglevel=None)[source]¶ Forward file object to
logging.Logger
instance.Parameters: -
closed
= False¶
-
loglevel
= 40¶
-
mode
= u'w'¶
-
name
= None¶
-
-
celery.utils.log.
set_in_sighandler
(value)[source]¶ Set flag signifiying that we’re inside a signal handler.