Log entries are captured and retain their structure.
(self)
| 20 | |
| 21 | class TestCaptureLogs: |
| 22 | def test_captures_logs(self): |
| 23 | """ |
| 24 | Log entries are captured and retain their structure. |
| 25 | """ |
| 26 | with testing.capture_logs() as logs: |
| 27 | get_logger().bind(x="y").info("hello", answer=42) |
| 28 | get_logger().bind(a="b").info("goodbye", foo={"bar": "baz"}) |
| 29 | assert [ |
| 30 | {"event": "hello", "log_level": "info", "x": "y", "answer": 42}, |
| 31 | { |
| 32 | "a": "b", |
| 33 | "event": "goodbye", |
| 34 | "log_level": "info", |
| 35 | "foo": {"bar": "baz"}, |
| 36 | }, |
| 37 | ] == logs |
| 38 | |
| 39 | def get_active_procs(self): |
| 40 | return get_config()["processors"] |
nothing calls this directly
no test coverage detected