Using reload to modify global subscriber once it's already been set #2454
Unanswered
vamshiaruru-virgodesigns
asked this question in
Q&A
Replies: 1 comment
-
Depending on how often you expect a user to call |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I need some help with setting up tracing in a little niche scenario. I am trying to write a logging library that can be used from python as a practice project. I'd like to expose a method where in the python code, the library user can do something like
My idea to implement this in rust would be to have separate writers for each logger with their own formatters and what not. Every time a
getLogger
is called, and formatter/sinks are added on the logger, I'd usereload
to update the global subscriber and set new writers and filters. I am a complete beginner, so my question is am I thinking in the right direction? Is there an easier way of doing this? Is it possible to just reset the global subscriber completely and build it from scratch every time, and would that be better?Any help is very appreciated. Thank you :)
Beta Was this translation helpful? Give feedback.
All reactions