picologging icon indicating copy to clipboard operation
picologging copied to clipboard

WIP: Change Logger frame objects

Open aminalaee opened this issue 1 year ago • 0 comments

Related to: https://github.com/microsoft/picologging/issues/124

import queue

import picologging
from picologging.handlers import QueueHandler, QueueListener

logger = picologging.Logger("test", picologging.DEBUG)
q = queue.Queue()
handler = QueueHandler(q)
logger.addHandler(handler)
logger.debug("test")
logger.debug("test")
q.get(block=False)
record = q.get(block=False)

print(record.filename)
print(record.module)

This reports <uknown> module and filename but with this PR we can use PyEval_GetFrame frame.

aminalaee avatar Sep 28 '23 15:09 aminalaee