-
Notifications
You must be signed in to change notification settings - Fork 51
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
Consistent use of logger? #233
Comments
The package was started a long time ago and various functions are added by various people across a very long period so the logging/exception/warning is not set up in a uniformed standard. My feeling is that if there is something that you wish the user to know it will be through logging.info
If there is an exception, it should be
These are the ideal standards but I'm well aware that almost no functions obey this. |
Great, I'll try to follow the more standard practice with my commits then! |
See also #34 |
Help is welcome — with PR #303 we now use |
I was trying to figure out how to make better use of logger/raise in the AMBER parser, and I checked other files in the project, so I took the advance and made a list of something I observed.
I have some comments for these files:
parsing/amber --> some Exceptions handled with logger.exception without raising a proper exception (this I have to change in issue AMBER: inconsistent use of
raise Exception
/logger.exception
#227parsing/gmx --> no logger, but also no raise (it's impossible to get an error while reading a gmx file?)
parsing/gomc --> no logger, but also no raise (no possible errors in the file?)
parsing/namd --> coherent, lot of logger.error/warning followed directly with a raise (maybe missing one at lines 81 and 239)
parsing/util --> no logger, but we have a raise ValueError without logging the error at line 79
postprocessors/units --> no logger, but we have different raise SOMETHING, without logging
preprocessing/subsampling --> no logger, but we have different raise SOMETHING, without logging
visualisation/* --> no logger, but we have different raise SOMETHING, without logging
init/concat --> no logger, just raised two ValueError without logging
I don't know if everything here is what is supposed to be, I'm new to the use of the logging module, I just wanted to report where I saw many
raise
without the logging of some information.Also, I noticed in some modules more than others we are extensively using logger.info, while in many more modules logger.info is never used, what's the rationale behind the decision to log something to
info
?info
is printed just if we increase the level of logging information right? Are we doing so in some part of the code?The text was updated successfully, but these errors were encountered: