celery.utils.log

celery.utils.log

Logging utilities.

class celery.utils.log.ColorFormatter(fmt=None, use_color=True)[源代码]

  • COLORS = {u’blue’: <bound method colored.blue of u’’>, u’black’: <bound method colored.black of u’’>, u’yellow’: <bound method colored.yellow 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’white’: <bound method colored.white of u’’>, u’red’: <bound method colored.red of u’’>}

  • colors = {‘DEBUG’: <bound method colored.blue of u’’>, ‘CRITICAL’: <bound method colored.magenta of u’’>, ‘WARNING’: <bound method colored.yellow of u’’>, ‘ERROR’: <bound method colored.red of u’’>}

  • format(record)[源代码]

  • formatException(ei)[源代码]

class celery.utils.log.LoggingProxy(logger, loglevel=None)[源代码]

Forward file object to logging.Logger instance.

参数:
  • logger – The logging.Logger instance to forward to.
  • loglevel – Loglevel to use when writing messages.
  • close()[源代码]

    When the object is closed, no write requests are forwarded to the logging object anymore.

  • closed = False

  • flush()[源代码]

    This object is not buffered so any flush() requests are ignored.

  • isatty()[源代码]

    Always return False. Just here for file support.

  • loglevel = 40

  • mode = ‘w’

  • name = None

  • write(data)[源代码]

    Write message to logging object.

  • writelines(sequence)[源代码]

    writelines(sequence_of_strings) -> None.

    Write the strings to the file.

    The sequence can be any iterable object producing strings. This is equivalent to calling write() for each string.

celery.utils.log.set_in_sighandler(value)[源代码]

celery.utils.log.in_sighandler(\args, **kwds*)

celery.utils.log.get_logger(name)[源代码]

celery.utils.log.get_task_logger(name)[源代码]

celery.utils.log.mlevel(level)[源代码]

celery.utils.log.ensure_process_aware_logger(force=False)[源代码]

Make sure process name is recorded when loggers are used.

celery.utils.log.get_multiprocessing_logger()[源代码]

celery.utils.log.reset_multiprocessing_logger()[源代码]