Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
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()
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
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()
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
    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
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
 def test_setup_logging_subsystem_colorize(self):
     setup_logging_subsystem(colorize=None)
     setup_logging_subsystem(colorize=True)
Exemplo n.º 10
0
 def test_setup_logging_subsystem_colorize(self):
     setup_logging_subsystem(colorize=None)
     setup_logging_subsystem(colorize=True)