-
Notifications
You must be signed in to change notification settings - Fork 22
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
Changing verboseprint into logger #195
Conversation
Sorry, could you be more explicit? Every function needs the 'verbose = VerbosePrint(verbose)' line in it, correct? And how would I use this for
|
Yep precisely that, if every function is constructed with the keyword argument
I've added this in, similarly to |
I don't like us using |
Possibly, and I agree for sure with having a different named variable: one for the Boolean switch, one for the instance. if verbose:
table.pprint_all() |
huh the comment for that last commit is supposed to say: |
Convert this into a logger function with debug and info levels |
I noticed in the tests that the logger messages weren't appearing, not sure what scripts to run to try the different levels e.g. logger.getLogger().setLevel = <logger.DEBUG/logger.INFO> Essentially, having someone able to dynamically change the level of the logging whilst pulling in Related: Any scripts which use the utils functions which change the kwarg |
So, because logging is configured by the user it's something that they get to control and it's likely pytest has some defaults for the logging level and the outputs of them, since it could be it prints info/debug to stdout but warning/error to stderr. We may just need to play around with setting the level in the tests as well. |
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.
While this looks good, I recommend we avoid using ''.join(map(str, []))
We don't need the added complexity for what we're doing and it makes the code far less readable. Stick to using f-strings, which we already had in some cases.
Now the only changes are so when you create a new function have a line saying:
then you can use