-
Notifications
You must be signed in to change notification settings - Fork 46
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
Prefix logger.warning messages with "WARNING:" #1050
Conversation
Preference is for coloured output to stdout. There is something for this in |
Do not change formatting of console messages. Colours are preferable.
5a8a6af
to
9c0c6fa
Compare
Following merge of #1057, this has been updated to only change the log file formatting. I agree with previous comments that colouring is preferable for console output. To that end, @Anthchirp can we get |
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.
Alternative suggestion:
If level >= warning then
print "WARN: log message"
"WARN: continuation"
else
print "time: log message"
" continuation"
util/log.py
Outdated
@@ -13,6 +13,9 @@ | |||
|
|||
# https://stackoverflow.com/questions/25194864/python-logging-time-since-start-of-program/25196134#25196134 | |||
class ElapsedFormatter: |
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 ElapsedFormatter
still an appropriate name then?
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.
not really... any ideas?
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.
DialsLogfileFormatter
?
Co-Authored-By: Markus Gerstel <2102431+Anthchirp@users.noreply.github.com>
Yes, that would highlight the warnings even better |
- Use the margin for the "WARN:" message - Rename formatter
Example
|
Use the colorlog (https://github.com/borntyping/python-colorlog) package to colour messages written to the log console. Currently blue for DEBUG, yellow for WARNING, red for ERROR. This complements #1050, which marks up warning messages in the log _file_ with an automatic prefix. Now that warnings are highlighted in some way either on the console or the log file, remove extraneous parts of various warning messages throughout the codebase. Closes #1034
This is a way of prefixing warning messages and thus make them stand out from general information messages in a consistent way. Draft for comments whether we want this kind of behaviour. This is for #1034.