Exemple #1
0
 def test_change_default(self):
     my_default = '%(asctime)s %(levelname)s %(name)s [%(request_id)s '\
                  '%(user_id)s %(project)s] %(instance)s'\
                  '%(message)s'
     log.set_defaults(logging_context_format_string=my_default)
     self.conf([])
     self.assertEqual(self.conf.logging_context_format_string, my_default)
Exemple #2
0
 def test_change_default_log_level(self):
     log.set_defaults(default_log_levels=['foo=bar'])
     self.conf([])
     self.assertEqual(['foo=bar'], self.conf.default_log_levels)
     self.assertIsNotNone(self.conf.logging_context_format_string)
Exemple #3
0
 def test_default_log_level_to_none(self):
     log.set_defaults(logging_context_format_string=None,
                      default_log_levels=None)
     self.conf([])
     self.assertEqual(log.DEFAULT_LOG_LEVELS, self.conf.default_log_levels)