I'm using wrap_logger
to wrap a logger which makes use of e.g. funcName
.
When using log = wrap_logger(logger)
, funcName
shows up as _proxy_to_logger
instead of whatever function is making the log—so I'd like to ensure that stacklevel=2
gets passed to the underlying logger (in fact, I'd like to ensure this is the case without having to explicitly pass it on every call, but maybe that's for another ticket).
If I do something like log.info("This is a log", stacklevel=2)
then structlog interprets this argument as a key-value pair to add to the event dictionary.
Anyone have any ideas?