-
Notifications
You must be signed in to change notification settings - Fork 1.2k
gmoccapy -add log levels to gmoccapy and getiniinfo #2323
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
Conversation
|
Really great Chris, thank you! 👍 👍 👍 |
hansu
left a comment
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.
Great job in assigning the log levels! I agree in almost most of the cases, however, I have still some suggestions.
And the correct order of log levels is DEBUG, INFO, VERBOSE, WARNING, ERROR, CRITICAL, is that right?
And they can be only set like this, right?
[DISPLAY]
DISPLAY = gmoccapy -q
Maybe it would be good to have a LOG_LEVEL in the DISPLAY section as well.
| logger.setGlobalLevel(logger.DEBUG) | ||
| LOG.debug('DEBUGGING logging on') | ||
| elif '-i' in sys.argv: | ||
| # Log level defaults to INFO, so set lower if in debug mode |
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.
| # Log level defaults to INFO, so set lower if in debug mode | |
| # Log level defaults to WARNING, so set lower if in debug mode |
defaults to WARNING if I get it right?
What about a flag for CRITICAL?
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.
yes i se the comments are wrong - copied from qtvcp and i changed the default level recently.
I'll need to fix them on qtvcp too. thanks
my opinion:
critical - in my mind if you have critical errors you should pretty much be logging then shutting down.
Having a critical log setting would block errors from showing. can't think of any reason you would want to hide errors.
verbose, debug, info, warning, error, critical LOG_LEVEL is more difficult because the log levels must be set before loading some libraries and before instantiating gmoccapy . Not impossible -just have to add code to parse the INI. i don;t know how to change the base branch - could you instruct me? |
|
Base has been changed, thanks ! |
|
I could squash together if you would prefer. |
Yeah would be nice. Have you any thoughts on my other comments? |
|
I thin I have answered all comments - if I have missed one please ask me again or point them out. |
This will allow the user to control the many debug messages sent to the terminal. It uses qtvcp's logging library so no reinventing the wheel. Other files should probably be converted to use logging too. Ultimately it would be nice if gmoccapy and qtvcp used the same INI parsing code too.
ff9fa22 to
2e8e43e
Compare
|
@c-morley What does this mean? |
|
That is the integer representation of the global log level. |
|
Then it feels a bit redundant, because it says first "INFO logging on" and then this. (Didn't remember if what it prints for default - WARNING). Another thing came into my mind while I had a look at the multi-line log messages. It would be nice if the output can be look like this: Currently, it's only possible either so or so First would be no problem if there were no other messages. For the second it's hard so see how many errors/warning there are actually. Dou you think that is a reasonable feature? |
|
for LOG.newline()to be useful one would need LOG.info_newline() plus all the other log levels. |
|
should be 8 spaces between \n and the 'and' |
I thought about a static class variable that "remembers" the last used log level.
Yeah that's what I was meaning in the sentence inside the parantheses. |
|
Let's skip this. This seems to be too much work for a bit improvement in readability. Because in the log file there has to be added number of spaces... |

This will allow the user to control the many debug messages sent to the terminal.
It uses qtvcp's logging library so no reinventing the wheel.
Other files should probably be converted to use logging too.
Resolves #2273