MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / test_structured_logging

Method test_structured_logging

tests/test_utils.py:1143–1154  ·  view source on GitHub ↗
(self, output)

Source from the content-addressed store, hash-verified

1141
1142 @capture_stderr
1143 def test_structured_logging(self, output):
1144 configure_logging(logger, level=logging.INFO, structured_output=True)
1145
1146 logger.info('test', extra=dict(key='value'))
1147
1148 # level is info+, json output contains the extra dict
1149 output.seek(0)
1150 lines = output.readlines()
1151 self.assertEqual(len(lines), 1)
1152 record = json.loads(lines[0])
1153 self.assertEqual(record.get('message'), 'test')
1154 self.assertEqual(record.get('key'), 'value')
1155
1156 @capture_stderr
1157 def test_secrets_in_structured_output(self, output):

Callers

nothing calls this directly

Calls 3

configure_loggingFunction · 0.90
seekMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected