summaryrefslogtreecommitdiff
path: root/oslo_log/tests/unit/test_log.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_log/tests/unit/test_log.py')
-rw-r--r--oslo_log/tests/unit/test_log.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/oslo_log/tests/unit/test_log.py b/oslo_log/tests/unit/test_log.py
index 7878525..84950a4 100644
--- a/oslo_log/tests/unit/test_log.py
+++ b/oslo_log/tests/unit/test_log.py
@@ -591,6 +591,22 @@ class JSONFormatterTestCase(LogTestBase):
# convert it using repr() to prevent serialization error on logging.
self.assertEqual(['repr'], data['args'])
+ def test_extra_args_filtered(self):
+ test_msg = 'This is a %(test)s line %%(unused)'
+ test_data = {'test': 'log', 'unused': 'removeme'}
+ self.log.debug(test_msg, test_data)
+
+ data = jsonutils.loads(self.stream.getvalue())
+ self.assertNotIn('unused', data['args'])
+
+ def test_entire_dict(self):
+ test_msg = 'This is a %s dict'
+ test_data = {'test': 'log', 'other': 'value'}
+ self.log.debug(test_msg, test_data)
+
+ data = jsonutils.loads(self.stream.getvalue())
+ self.assertEqual(test_data, data['args'])
+
def get_fake_datetime(retval):
class FakeDateTime(datetime.datetime):