Closed skoot closed 3 years ago
I'm having the same error using this config:
structlog.configure(
processors=[
structlog.stdlib.filter_by_level,
structlog.processors.TimeStamper(fmt="iso"),
structlog.stdlib.add_logger_name,
structlog.stdlib.add_log_level,
structlog.stdlib.PositionalArgumentsFormatter(),
structlog.processors.TimeStamper(fmt="iso"),
structlog.processors.StackInfoRenderer(),
structlog.processors.format_exc_info,
structlog.processors.UnicodeDecoder(),
structlog.processors.ExceptionPrettyPrinter(),
structlog.dev.ConsoleRenderer(),
],
context_class=structlog.threadlocal.wrap_dict(dict),
logger_factory=structlog.stdlib.LoggerFactory(),
wrapper_class=structlog.stdlib.BoundLogger,
cache_logger_on_first_use=True,
)
I realised that it only happened to me when I was running all tests but not when running one specific test, so looking around I found this https://github.com/hynek/structlog/issues/76#issuecomment-240373958, which right away fixed my issue. Hope it helps.
@skoot @menecio I believe this should be resolved in v0.4, would you mind to try it out and report back please?
Happy to report that it seems to have fixed the issue for us.
Version 0.3 breaks our tests. We use django and configure structlog in our settings.py file.
When we run the tests we now get this error:
Originally posted by @skoot in https://github.com/wimglenn/pytest-structlog/issues/10#issuecomment-686408689