Ignore frames in `_FixedFindCallerLogger`
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reading structlog.stdlib.LoggerFactory and _FixedFindCallerLogger, especially how the logger class handles caller frames and stacklevel. Compare that behavior with the standard library’s logging stack level handling. Done means agreeing on an approach and supporting configurable ignored frames or correctly passing and handling stacklevel; the issue names no tests to run.
Written by the indexing model from the issue text.
Description
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!
- Dominant language
- Python
- Stars
- 5k
- Forks
- 302
- Avg merge
- 17m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hynek/structlog
-
bind_contextvars is not thread-safe?Possibly taken @nosmile99 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Transform examples in docs into included source filesPossibly taken @alexchen-sys claimed this 98 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
waiting for feedback
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Download helper still uses huggingface_hub arguments removed in 1.0: USE_SYMLINKS is silently ignored and every download ends with a WinError 3 linePossibly taken @li-lizhe claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
IPv6 node addresses produce an invalid request URLPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
typesense/typesense-python#154 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
elastic/elasticsearch-py#3592 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
developmentseed/titiler-cmr#250 · 1 comment ·
Maintainers usually reply within 1 day