madzak / python-json-logger

Json Formatter for the standard python logger
BSD 2-Clause "Simplified" License
1.7k stars 231 forks source link

use assertions to test if all supported keys are set #104

Closed matanshavit closed 3 years ago

matanshavit commented 3 years ago

Changes testFormatKeys to use assertions that will fail if any of the supported keys does not produce output in the formatted JSON. Quality assurance - If any additional keys are added to supported_keys, the formatter will not find a value in the record, and the value in the output will be None, so assertIsNotNone will fail for that key. Resolves https://github.com/madzak/python-json-logger/issues/103