-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
logging basic configuration level: INFO vs. WARNING (usability with W&B) #710
Comments
Honestly, best practice is for libraries not to configure logging at all. That way the user can set it up however they want. When libraries configure logging, you get weird things like this. logging.basicConfig(level=logging.DEBUG)
import pytorch_lightning.logging
# now log level is INFO :( @williamFalcon thoughts on leaving logging configuration to the users? |
the issue with logging is that it has to be sett by |
I will need to check it... |
Okay, spent a little bit of time thinking about this. I think it's fine to setup the lightning logger for the user, but we shouldn't be touching other loggers (e.g. WandB). To give a little more visibility to the user, what do we think about adding another arg to Trainer?
Then in the code, we do something like if log_level is not None:
logging.getLogger("pytorch_lighting").setLevel(log_level) @Borda @williamFalcon Any thoughts? Only downside I see is yet another argument to |
I think the best practice is actually letting the package use dedicated logger, just as @neggert wrote: use |
It's fine if default level of dedicated logger is set, since it won't change the level of other loggers, while users can still change the logger level if they want And also the loggers under |
yeah, having different logging level per logger sounds good... on the other hand, experiment-like logger does not save any logging messages aka terminal... |
since #825 we support multiple loggers... The common practice is to have a |
By "logging" I mean maybe the text logging (with |
Sounds interesting, @cmpute mind submit PR with your suggestion? |
@Borda sure, I can have a try |
Thanks for the amazing package! I am having a great time using it.
Issue
Recently, I have been playing around with the weights and biases (W&B) logging functionality and I noticed that I was getting a lot of logging messages in my jupyter notebook while training my model (every epoch I got new messages).
When I looked into
logging.__init__.py
, the logging basic configuration was set with:logging.basicConfig(level=logging.INFO)
However, that means a lot of INFO messages are being printed from W&B's use of the logger (e.g. when the RunManager modifies files).
Potential Solution
To disable this, I switched the logging basic configuration in
logging.__init__.py
to:logging.basicConfig(level=logging.WARNING)
Would this be a useful addition in general to the package or should I just keep this change local?
The text was updated successfully, but these errors were encountered: