Comments (1)
Trying the above example results in:
assert record.module == "python"
assert record.filename == "python.py"
which is coming from https://github.com/pytest-dev/pytest/blob/main/src/_pytest/python.py not sure why.
But interestingly if you try this:
# example.py file
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)
assert record.filename == "<unknown>"
assert record.module == "<unknown>"
I think it has something to do how frames objects are accessed. I will create a temporary PR to see how it can fix the <unkown>
issue.
from picologging.
Related Issues (20)
- LogRecord is not copy-able
- Make a pytest fixture for log capture HOT 1
- Build ARM64 wheels for Windows
- Windows ARM64 not included in ZIP file generated in GitHub Actions
- Linux aarch64 wheels missing
- logger does not have isEnabledFor()
- Logging to a file doesn't work with `AttributeError: module 'io' has no attribute 'text_encoding'` in python3.9 HOT 1
- Support passing a string to `setLevel`.
- Picologging leaks memory when used in an ASGI Framework HOT 9
- Crash using coloredlogs HOT 1
- Python 3.12 support
- Fix all leaky PyUnicode_FromString uses
- investigate pytest warning on unclosed resources
- Using pytest-memray in CI HOT 1
- Python code crashes if I use %f in datefmt HOT 1
- Optimize logger.logMessageAsRecord
- Implement METH_FASTCALL where possible
- Optimize level name field in Log Record
- log `extra` param does not work with picologging HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picologging.