LoggingPlugin¶
LoggingPlugin
¶
Bases: BasePlugin
Logging interception plugin.
Patches logging.Logger._log globally. Uses reference counting so nested sandboxes work correctly, following the SubprocessPlugin pattern.
Source code in src/bigfoot/plugins/logging_plugin.py
install
¶
No-op. Called to ensure plugin is registered before sandbox entry.
Access to any attribute of log_mock triggers plugin creation via _LoggingProxy.getattr. This method exists as a named no-op so tests that want the interceptor active without any mocks have an explicit API to call.
Source code in src/bigfoot/plugins/logging_plugin.py
mock_log
¶
Register a FIFO log mock.
Calls are matched in registration order. Unlike subprocess.run, unmocked log calls are swallowed (fire-and-forget) and recorded on the timeline, requiring assertion at teardown.
Source code in src/bigfoot/plugins/logging_plugin.py
assert_log
¶
Assert the next log interaction with all 3 fields.
Source code in src/bigfoot/plugins/logging_plugin.py
assert_debug
¶
assert_info
¶
assert_warning
¶
assert_error
¶
assert_critical
¶
activate
¶
Reference-counted class-level patch installation.