def test_setup_logging_subsystem_no_mputil(self): mputil, log.mputil = log.mputil, None log.mputil try: log.setup_logging_subsystem() finally: log.mputil = mputil
def set_up_logging(): """Set up logging.""" # This import has side effects (it imports celeryconfig) and may # produce warnings (if there is no celeryconfig). # Postpone the import so that we don't go through that every time # anything imports this module. from celery.log import setup_logging_subsystem setup_logging_subsystem()
def test_setup_logging_subsystem_no_mputil(self): from celery.utils import log as logtools mputil, logtools.mputil = logtools.mputil, None try: log.setup_logging_subsystem() finally: logtools.mputil = mputil
def redirect_stdouts_to_logger(self): from celery import log handled = log.setup_logging_subsystem(loglevel=self.loglevel, logfile=self.logfile) # Redirect stdout/stderr to our logger. if not handled: logger = log.get_default_logger() log.redirect_stdouts_to_logger(logger, loglevel=logging.WARNING)
def setup_logging(self): from celery import log handled = log.setup_logging_subsystem(loglevel=self.loglevel, logfile=self.logfile) logger = log.get_default_logger(name="celery.beat") if self.redirect_stdouts and not handled: log.redirect_stdouts_to_logger(logger, loglevel=self.redirect_stdouts_level) return logger
def redirect_stdouts_to_logger(self): from celery import log handled = log.setup_logging_subsystem(loglevel=self.loglevel, logfile=self.logfile) # Redirect stdout/stderr to our logger. if not handled: logger = log.get_default_logger() if self.redirect_stdouts: log.redirect_stdouts_to_logger( logger, loglevel=self.redirect_stdouts_level)
def test_setup_logging_subsystem_colorize(self): setup_logging_subsystem(colorize=None) setup_logging_subsystem(colorize=True)