-
Notifications
You must be signed in to change notification settings - Fork 3
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
Don't show spinner with verbose output #160
Conversation
When verbose output is enabled via the `-v` option, the spinner mucks the extra output. Closes aiidalab#146
Codecov ReportBase: 86.63% // Head: 86.72% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
==========================================
+ Coverage 86.63% 86.72% +0.08%
==========================================
Files 9 9
Lines 898 904 +6
==========================================
+ Hits 778 784 +6
Misses 120 120
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
One little question.
aiidalab_launch/util.py
Outdated
|
||
# Don't show spinner if verbose output is enabled | ||
level = logging.getLogger().getEffectiveLevel() | ||
if level != 0 and level < 40: |
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 am not very experienced with this particular code, but the level < 40
condition seems strange. If a higher number means "more verbose", then there should be no upper limit, no?
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.
@danielhollas Is the user allowed to change the level? If I understand correctly, the level is increased by adding more v
? If this is the case, it is better to update the help information of -v
.
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.
@yakutovicha actually, the level indicates severity, so lower number means less severe, hence more verbose. See
https://docs.python.org/3/library/logging.html#logging-levels
The default level is logging.ERROR
which is 40. I have replaced the hardcoded numbers with the proper variables from the logging module, thanks for pointing this out.
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.
Is the user allowed to change the level? If I understand correctly, the level is increased by adding more v? If this is the case, it is better to update the help information of -v.
@unkcpz yes, you can adjust the level based on the number of v
s. The current help says
Provide this option to increase the output verbosity of the launcher.
@yakutovicha @unkcpz do you have suggestion how to improve this? I cannot figure out how to word this concisely.
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 am sure no good at wording docs. I check the python cmdline doc https://docs.python.org/3/using/cmdline.html#cmdoption-1. We can assume the user only uses -v
and -vv
and for -vv
giving the detail of what will be printed more, phrased like "When given twice (-vv), .."
@yakutovicha @unkcpz I've refactored the code a bit, the original approach wasn't handling newlines correctly. I've also tried to improve the description of the |
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.
Almost good to go for me. Just one little suggestion.
@unkcpz if this looks good to you, could you please merge and then publish a new version of |
When verbose output is enabled via the
-v
option, the spinner interferes with the extra output.Closes #146