Binding without creating a new logger
See original GitHub issueI’m wondering if we can have new APIs that can bind and unbind structured arguments in place (i.e. without creating a new logger). Maybe an add_extra
and a remove_extra
method? I also think it’ll be useful if Logger._extra
can be promoted to a public member for viewing (a getter property would suffice).
The motivation here is that I want to be able to do from loguru import logger
from all my modules and get the structured arguments I’ve set elsewhere. I can workaround this issue by keeping my own logger registry or adding values to _extra
directly but I think it’ll be nice if this can be officially supported.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Logging Cookbook — Python 3.11.1 documentation
Running a logging socket listener in production This example setup shows how the workers can write to the same log file without conflicting...
Read more >Need Solution for multiple slf4j binding without removing other ...
I have created custom Staticbinder inside org.slf4j.impl package to redirect to logback inside my project. but it doesn't worked when converts ...
Read more >SLF4J Manual
An SLF4J binding designates an artifact such as slf4j-jdk14.jar or slf4j-log4j12.jar used to bind slf4j to an underlying logging framework, say, java.util.
Read more >Java Logging Basics - The Ultimate Guide To Logging - Loggly
Creating a New Logger. The process of creating a new Logger is similar across logging frameworks, although the exact method names may be...
Read more >Enabling logging in BIND
Introduction. By default, logs from named are sent to /var/log/syslog via syslog. Goals. Make BIND log more useful information. Notes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The new
contextualize()
method is available inv0.4.0
just released. 👍Fixed on
master
, finally. 🎉It uses
contextvars
for Python 3.7+ and relies on theaiocontextvars
backport for earlier versions.I will close this issue once the next Loguru release is published.