Fix regression causing the default log level to become WARNING
Change I96229438d3a2271c830bcd926326e7b4a94ccac9 removed the verbose option in the opposite fashion from what how it was intended when the option was deprecated. It regressed the default log level back to WARNING. See change I306535c6ca5dbdaf9398b44697578a3a30e52111 for original reasoning behind this deprecation. This change fixes the default level as it was intended. Change-Id: Ia9cd55004ce05761de733adae00554ff021794a8
This commit is contained in:
parent
7c671ea77f
commit
07c3c287f7
@ -322,7 +322,7 @@ def _refresh_root_level(debug):
|
||||
if debug:
|
||||
log_root.setLevel(logging.DEBUG)
|
||||
else:
|
||||
log_root.setLevel(logging.WARNING)
|
||||
log_root.setLevel(logging.INFO)
|
||||
|
||||
|
||||
def _setup_logging_from_conf(conf, project, version):
|
||||
|
@ -97,12 +97,12 @@ class CommonLoggerTestsMixIn(object):
|
||||
logger = logging.getLogger(logger_name)
|
||||
self.assertEqual(logging.DEBUG, logger.getEffectiveLevel())
|
||||
|
||||
def test_will_be_warning_if_debug_flag_not_set(self):
|
||||
def test_will_be_info_if_debug_flag_not_set(self):
|
||||
self.config(debug=False)
|
||||
logger_name = 'test_is_not_debug'
|
||||
log.setup(self.CONF, logger_name)
|
||||
logger = logging.getLogger(logger_name)
|
||||
self.assertEqual(logging.WARNING, logger.getEffectiveLevel())
|
||||
self.assertEqual(logging.INFO, logger.getEffectiveLevel())
|
||||
|
||||
def test_no_logging_via_module(self):
|
||||
for func in ('critical', 'error', 'exception', 'warning', 'warn',
|
||||
@ -831,7 +831,7 @@ class FastWatchedFileHandlerTestCase(BaseTestCase):
|
||||
log_path = self._config()
|
||||
logger = log._loggers[None].logger
|
||||
text = 'Hello World!'
|
||||
logger.warning(text)
|
||||
logger.info(text)
|
||||
with open(log_path, 'r') as f:
|
||||
file_content = f.read()
|
||||
self.assertTrue(text in file_content)
|
||||
@ -865,7 +865,7 @@ class ConfigTestCase(test_base.BaseTestCase):
|
||||
|
||||
log._setup_logging_from_conf(conf, 'test', 'test')
|
||||
self.assertEqual(conf.debug, False)
|
||||
self.assertEqual(log.WARN, log_root.getEffectiveLevel())
|
||||
self.assertEqual(log.INFO, log_root.getEffectiveLevel())
|
||||
|
||||
shutil.copy(paths[1], paths[0])
|
||||
conf.mutate_config_files()
|
||||
|
4
releasenotes/notes/info-logging-7b7be9fc7a95aebc.yaml
Normal file
4
releasenotes/notes/info-logging-7b7be9fc7a95aebc.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
fixes:
|
||||
- When removing the "verbose" option, the default logging level was set to
|
||||
"WARNING" by mistake. Fixed it back to "INFO".
|
Loading…
Reference in New Issue
Block a user