Example #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
Example #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
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()
Example #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
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()
Example #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)
Example #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
Example #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)
Example #9
0
 def test_setup_logging_subsystem_colorize(self):
     setup_logging_subsystem(colorize=None)
     setup_logging_subsystem(colorize=True)
Example #10
0
 def test_setup_logging_subsystem_colorize(self):
     setup_logging_subsystem(colorize=None)
     setup_logging_subsystem(colorize=True)