Comments (1)
I just ran into this! I didn't fix it myself since I found your TODO, but here's a test for it (based off the CPython test):
def test_stream_error_handling():
class BadStream(object):
def write(self, data):
raise RuntimeError('deliberate mistake')
class TestStreamHandler(picologging.StreamHandler):
def handleError(self, record):
self.error_record = record
handler = TestStreamHandler(BadStream())
record = picologging.makeLogRecord({})
handler.handle(record)
assert handler.error_record is record
handler = picologging.StreamHandler(BadStream())
with pytest.raises(RuntimeError, match="RuntimeError: deliberate mistake"):
handler.handle(record)
This test currently fails since TestStreamHandler handleError isn't being called.
from picologging.
Related Issues (20)
- 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
- Using `asctime` in formatter messes up timestamp encoding HOT 2
- No type annotations
- Can't add a custom `stream` to `SteamHandler` using `dictConfig`
- Broken when exc_info argument is provided to the log() method
- Picologging is deadlocking when multiple threads are logging 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.