Drop lack of syslog warning to debug level logging

The current warning spams openstackclient output with multiple log messages
(one for every call to getLogger in the entrypoints that are loaded). Drop
the message to debug level.

Resolves: rhbz#2227201
Change-Id: Ib32146020f5869c88cc8becf41c9245a0c4863c3
This commit is contained in:
Oliver Walsh 2023-07-28 11:33:20 +01:00 committed by Jiri Podivin
parent 70c3ac1d14
commit feba372e2d
2 changed files with 4 additions and 4 deletions

View File

@ -42,6 +42,6 @@ def getLogger(loggerName, stream_lvl=logging.WARN):
new_logger.addHandler(sys_handler)
else:
new_logger.warning("Journal socket does not exist. Logs will not be processed by syslog.")
new_logger.debug("Journal socket does not exist. Logs will not be processed by syslog.")
return new_logger

View File

@ -35,10 +35,10 @@ class TestLogger(TestCase):
mock_exists.assert_called_once_with('/dev/log')
self.assertEqual(logging.Logger, type(new_logger))
@mock.patch('logging.Logger.warning')
@mock.patch('logging.Logger.debug')
@mock.patch('os.path.exists', return_value=False)
def test_logger_init_no_journal(self, mock_exists, mock_warning):
def test_logger_init_no_journal(self, mock_exists, mock_debug):
new_logger = logger.getLogger("fooo")
mock_exists.assert_called_once_with('/dev/log')
mock_warning.assert_called_once()
mock_debug.assert_called_once()
self.assertEqual(logging.Logger, type(new_logger))