Ejemplo n.º 1
0
    def setUp(self):
        # we init the logs before each test because nosetest redefines
        # sys.stdout and removes all the handlers from the rootLogger

        # reset logging config (otherwise will ignore logfile flag)
        cleanup_loggers()

        flags.FLAGS.debug = 'warn'
        flags.FLAGS.logfile = LOG_FILE_PATH
        logs.init_logs(log_type='console', level='warn')
        java.init_logs(log_type='console', level='warn')
Ejemplo n.º 2
0
    def setUp(self):
        # save and override process name
        self.process_name = multiprocessing.current_process().name
        multiprocessing.current_process().name = '->UnitTestProcess<-'

        # reset Log4j config
        jvm = java.jvm()
        jvm.JClass("org.apache.log4j.BasicConfigurator").resetConfiguration()

        # reset logging config
        cleanup_loggers()

        # setup AMQP logging
        logs.init_logs(log_type='amqp', level='debug')
        java.init_logs(log_type='amqp', level='debug')
        job.setup_job_logging('123')
Ejemplo n.º 3
0
    def tearDown(self):
        # reconfigure Log4j with the default settings
        jvm = java.jvm()

        jvm.JClass("org.apache.log4j.BasicConfigurator").resetConfiguration()
        java.init_logs(level='warn')