diff --git a/oslo_log/log.py b/oslo_log/log.py index dabce127..3d870520 100644 --- a/oslo_log/log.py +++ b/oslo_log/log.py @@ -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): diff --git a/oslo_log/tests/unit/test_log.py b/oslo_log/tests/unit/test_log.py index 77df9ed8..b1c69d84 100644 --- a/oslo_log/tests/unit/test_log.py +++ b/oslo_log/tests/unit/test_log.py @@ -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() diff --git a/releasenotes/notes/info-logging-7b7be9fc7a95aebc.yaml b/releasenotes/notes/info-logging-7b7be9fc7a95aebc.yaml new file mode 100644 index 00000000..935d35fb --- /dev/null +++ b/releasenotes/notes/info-logging-7b7be9fc7a95aebc.yaml @@ -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".