microsoft / microsoft/picologging

The module is not reported correctly on handled records

Open
#124 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cpython-incompatibility
Dominant language
Python
Stars
779
Forks
29
Avg merge
23h 3m
Merged PRs (30d)
1

Description

I noticed this issue while working on the QueueHandler.

The following test succeeds with CPython logging but fails with picologging:

def test_queue_handler_dispatch():
    logger = picologging.Logger("test", picologging.DEBUG)
    q = queue.Queue()
    handler = QueueHandler(q)
    logger.addHandler(handler)
    logger.debug("test")
    record = q.get(block=False)
    assert record.module == "test_queuehandler"

In picologging, the module is reported as simply "python" instead. I haven't dug in yet to see where the problem is.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the test_queue_handler_dispatch example and the QueueHandler path, then compare how picologging and CPython logging determine the record module. Run the test to reproduce the failure; done means the queued record reports "test_queuehandler" instead of "python".

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.