Hi y'all,
I'm currently writing a wrapper for the standard logger to make the log calls look a certain way.
The problem is that my wrapper ends up in the stack trace when adding information like line number / calling module to the log.
The standard library allows fixing this by increasing the stack level:
logger = logging.getLogger()
logger.info("Hi, stacklevel=2)
Structlog does something similar when providing the parameter "ignore_frame_names" for the structlog.stdlib.LoggerFactory. Problem is that the LoggerFactory sets a LoggerClass which ignores the stacklevel number and which is not parametrizable.
it would be great if the ignored frames could be changed without overriding stuff or (probably the better solution) the stacklevel param would be passed on and handled correctly.
Happy to contribute once we agree on a solution!
Hi y'all,
I'm currently writing a wrapper for the standard logger to make the log calls look a certain way.
The problem is that my wrapper ends up in the stack trace when adding information like line number / calling module to the log.
The standard library allows fixing this by increasing the stack level:
Structlog does something similar when providing the parameter "ignore_frame_names" for the
structlog.stdlib.LoggerFactory. Problem is that the LoggerFactory sets a LoggerClass which ignores the stacklevel number and which is not parametrizable.it would be great if the ignored frames could be changed without overriding stuff or (probably the better solution) the
stacklevelparam would be passed on and handled correctly.Happy to contribute once we agree on a solution!