mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Make it possible to configure log level for exception tracebacks (#1311)
If you set `log.traceback_level=DEBUG`, the tracebacks will be visible only when `log.level=DEBUG`. The default behavior remains the same.
This commit is contained in:
committed by
Alexander Kukushkin
parent
f1819443ef
commit
49d3968c23
+2
-1
@@ -22,6 +22,7 @@ class TestPatroniLogger(unittest.TestCase):
|
||||
def test_patroni_logger(self):
|
||||
config = {
|
||||
'log': {
|
||||
'traceback_level': 'DEBUG',
|
||||
'max_queue_size': 5,
|
||||
'dir': 'foo',
|
||||
'file_size': 4096,
|
||||
@@ -50,7 +51,7 @@ class TestPatroniLogger(unittest.TestCase):
|
||||
logger.reload_config(config['log'])
|
||||
with patch.object(logging.Logger, 'makeRecord',
|
||||
Mock(side_effect=[logging.LogRecord('', logging.INFO, '', 0, '', (), None), Exception])):
|
||||
logging.error('test')
|
||||
logging.exception('test')
|
||||
logging.error('test')
|
||||
with patch.object(Queue, 'put_nowait', Mock(side_effect=Full)):
|
||||
self.assertRaises(SystemExit, logger.shutdown)
|
||||
|
||||
Reference in New Issue
Block a user