Closed wimglenn closed 5 months ago
After upgrading from 0.9 to version 1.0 (which seems to contain only this PR), i've now gotten very verbose output when running tests (without even running with the verbose flag to pytest), that I didn't use to get before. I don't see this change mentioned in the changelog, or a way to turn it off:
EDIT: I do see now that this is in fact due to running pytest with the -vv
flag. However, I do need that since I am also using pytest-clarity, which requires that flag to print pretty diffs on failures.
Is there no other way to still be able to silence this new output from pytest-structlog?
Plugin pytest-structlog is operating in keep mode.
- cmdline-arg: (empty)
- config-file: (empty)
- default-keep-list:
ExceptionRenderer
PositionalArgumentsFormatter
add_log_level
dict_tracebacks
merge_contextvars
Structlog processor 'merge_contextvars' is kept due to default-keep-list (<function merge_contextvars at 0x1038a98a0>).
Structlog processor 'filter_by_level' is evicted because no configuration kept it (<function filter_by_level at 0x10447cea0>).
Structlog processor 'TimeStamper' is evicted because no configuration kept it (<structlog.processors.TimeStamper object at 0x10604af80>).
Structlog processor 'add_logger_name' is evicted because no configuration kept it (<function add_logger_name at 0x10447db20>).
Structlog processor 'add_log_level' is kept due to default-keep-list (<function add_log_level at 0x1038ab920>).
Structlog processor 'PositionalArgumentsFormatter' is kept due to default-keep-list (<structlog.stdlib.PositionalArgumentsFormatter object at 0x105ff9610>).
Structlog processor 'StackInfoRenderer' is evicted because no configuration kept it (<structlog.processors.StackInfoRenderer object at 0x105f86800>).
Structlog processor 'CallsiteParameterAdder' is evicted because no configuration kept it (<structlog.processors.CallsiteParameterAdder object at 0x10604afc0>).
Structlog processor 'SentryProcessor' is evicted because no configuration kept it (<structlog_sentry.SentryProcessor object at 0x105d4e5a0>).
Structlog processor 'ExceptionRenderer' is kept due to default-keep-list (<structlog.processors.ExceptionRenderer object at 0x103902750>).
Structlog processor 'UnicodeDecoder' is evicted because no configuration kept it (<structlog.processors.UnicodeDecoder object at 0x1058df860>).
Structlog processor 'ProcessorFormatter.wrap_for_formatter' is evicted because no configuration kept it (<function ProcessorFormatter.wrap_for_formatter at 0x10447e0c0>).
Is this an accidental regression, and/or is there a way to silence this output by default?
Intentional. This is not an accidental regression, and it is mentioned in the README (which was part of this PR):
Using
pytest -v
orpytest -vv
you can see more details about which processorspytest-structlog
has included or excluded during the test startup.
pytest-structlog 1.0 will report which processors are kept/evicted from configuration, and whether to display that info is keyed off the verbosity level that pytest is running under.
It would be possible to add a configuration option to control this reporting, like auto/always/never.
@stianjensen In 1.1, reporting of pytest-structlog's own settings can also be explicitly enabled/disabled independently of verbosity level by specifying --structlog-settings-report always/never
(cmdline) or structlog_settings_report
(ini)
closes https://github.com/wimglenn/pytest-structlog/issues/34