Skip to content

Ignore frames in _FixedFindCallerLogger #602

Description

@wochinge

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions