Comments (5)
Great question, I'm still working on the basics for this library, but one of the first production use cases is an async worker and the reason I started this project is because the standard library logging module causes such an overhead.
I'll have a think about this next and update the thread
from picologging.
Looking at the stdlib implementation, it was added in Python 3.2. I'd probably do it differently today. It's using pickling/copy.copy
for thread safety and a worker thread, but a single one.
Firstly adding an async Handler and Logger specification, with a coroutine for .info()
, .warning()
etc. and then using an internal asyncio queue to write records and then sending those to the handlers in a worker thread, or within the coroutine. There are async stream writers for the outputs of the handler, so it would implement coroutines from top to bottom.
This library only supports Python 3.7+ anyway.
Not sure on the performance gains/losses compared to the queue, listener and worker thread approach.
What do you think?
from picologging.
Try 0.6.0, it comes with a queue handler and listener. I'm working on the async stuff later
from picologging.
Great. I'd gladly contribute as well when there is more clarity
from picologging.
Sounds good. I also don't know about the performance differences, but I would assume that an async approach would scale better .
from picologging.
Related Issues (20)
- LogRecord is not copy-able
- The module is not reported correctly on handled records HOT 1
- 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.