diff options
Diffstat (limited to 'tests/tests.py')
| -rw-r--r-- | tests/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/tests.py b/tests/tests.py index 7a488e6..9ca4261 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -42,6 +42,16 @@ class TestJsonLogger(unittest.TestCase): self.assertEqual(logJson["message"], msg) + def testRenameBaseField(self): + fr = jsonlogger.JsonFormatter(rename_fields={'message': '@message'}) + self.logHandler.setFormatter(fr) + + msg = "testing logging format" + self.logger.info(msg) + logJson = json.loads(self.buffer.getvalue()) + + self.assertEqual(logJson["@message"], msg) + def testFormatKeys(self): supported_keys = [ 'asctime', |
