MCPcopy Create free account
hub / github.com/hynek/structlog / test_native_logger

Method test_native_logger

tests/test_stdlib.py:1366–1380  ·  view source on GitHub ↗

If the log entry comes from structlog, it's unpackaged and processed.

(self, capsys)

Source from the content-addressed store, hash-verified

1364 assert isinstance(eds[0]["_record"], logging.LogRecord)
1365
1366 def test_native_logger(self, capsys):
1367 """
1368 If the log entry comes from structlog, it's unpackaged and processed.
1369 """
1370 logger = logging.getLogger()
1371 eds = configure_logging(None, logger=logger)
1372
1373 get_logger().warning("foo")
1374
1375 assert (
1376 "",
1377 "[warning ] foo [in test_native_logger]\n",
1378 ) == capsys.readouterr()
1379 assert eds[0]["_from_structlog"] is True
1380 assert isinstance(eds[0]["_record"], logging.LogRecord)
1381
1382 def test_foreign_pre_chain_filter_by_level(self, capsys):
1383 """

Callers

nothing calls this directly

Calls 3

get_loggerFunction · 0.90
configure_loggingFunction · 0.85
warningMethod · 0.45

Tested by

no test coverage detected