-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify logs management #1696
Simplify logs management #1696
Conversation
…file and configure the handlers properly
I dug a bit more in the loggers situation. I was hoping to find a simple solution, but right now what I proposed seems to be the simplest possible. I have a couple of ideas for improving the current status:
With both the above points, the entire logs configuration code could be summarized in two lines in logging.basicConfig(format="%(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.WARNING)
logging.getLogger("haystack").setLevel(logging.INFO) which I actually like a lot more than what I've created so far 😅 |
…aystack into single_module_logger_levels
Note for the review: I suggest cloning the branch and run a couple of tutorials to check if the output is too verbose (It is definitely way more verbose than it was before). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me! I ran a few tutorials and noticed that when we load a Reader model, we print device information twice, so I fixed that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested with Tutorial 1 and the logs are back to the old, verbose state. Probably even a bit more verbose now.
As discussed, let's clean up a bit and adjust the log level of a few messages. Made some suggestions here. It should be quick to do this first iteration based on output of tutorial 1 now and then we can iterate on smaller log messages that catch out attention in the next weeks.
@brandenchan I was wondering if we need to update any information in the documentation about activating debug in pipe.run()
as we dropped the debug_logs
param here and are not returning the logs anymore. However, I couldn't find it in the docs anywhere. My best guess was this section but this is rather about adding debug information for custom nodes. Do we have this already documented anywhere else?
I've been running a few more tutorials and noticed some other logs that might change level:
|
Yeah, first one can go to info. Second to Debug even, I'd say |
Related to #1683 and #1538
With the Pipeline's debug functionality, the behavior of the root logger was modified in a way that affected some Haystack submodules' loggers. This PR should restore their original behavior.
Note: as you can see, the PR introduces a little block of code in each of the submodules. The code is identical, so a small function could be made out of it. However, I think hiding this configuration in a function might make less obvious how the loggers work for that specific submodule, which might cause subtle problems later. Opinions welcome 🙂
UPDATE: following a deeper look at the current status, we decided to simplify the whole logger's situation along the lines of #1714, and I'm updating this PR in that direction.
Checklist:
WARNING
to keep most of the underlying libraries quiet (Elasticsearch, FAISS, etc)haystack
logger toINFO
to see enough logs during the execution of tutorials and scriptsDEBUG
and a few others up toINFO
haystack
in a standard way