Comments (3)
I might be missing something but even the standard library logging doesn't assert this:
def test_case():
logger = logging.Logger("test")
logger.parent = logging.Logger("parent", logging.WARNING)
stream = io.StringIO()
handler = logging.StreamHandler(stream)
logger.addHandler(handler)
logger.log(logging.DEBUG, "Hello World")
assert stream.getvalue() == ""
logger.parent.setLevel(logging.DEBUG)
logger.log(logging.DEBUG, "Hello World")
assert stream.getvalue() == "Hello World\n" # Failing
And then the test with picologging has the same behaviour and does not pass either.
from picologging.
I've actually added the suggested situation in my latest PR, https://github.com/microsoft/picologging/pull/108/files#diff-7c31002b037ae4bc2888350bb25d9b9621c6aff7e98d6e6871a8a649d088e27bR516
I changed the test to use getLogger and dots in the name for parent setting, as the logging library does not encourage directly using the constructor or directly setting the parent. With those changes, the test passes in stdlib and my branch.
from picologging.
Change merged!
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.