-
Notifications
You must be signed in to change notification settings - Fork 110
Add different log levels #631
Conversation
Merge current JM/Develop
level (log.info(), log.warn() or log.error()). No changes in any program logic. DEBUG also still default log level.
…nt to them. Change all log.debug() lines in every .py file to the appropriate log level (log.debug(), log.info(), log.warn() or log.error()). No changes in any program logic. DEBUG also still default log level.
|
As a next step, I think there should be an option in joinmarket.cfg to set the desired log level for console outputs (file logs should always use DEBUG, imho). It could default to the INFO level, unless explicitly changed. |
|
It's great to see someone kicked this off finally! :) Now let's start bikeshedding :) I had the same thought about the logfile. I'll try to make some comments tomorrow. |
joinmarket/message_channel.py
Outdated
| return | ||
| else: | ||
| log.debug("Failed to send message to: " + str(nick) + \ | ||
| log.warn("Failed to send message to: " + str(nick) + \ |
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.
This one could happen very often e.g. if there is a spy connecting/disconnecting. I think info or debug would be fine, but I don't mind.
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.
Don't mind either way, assumed this doesnt happen often since I have not seen that message yet. I'd favor info.
joinmarket/support.py
Outdated
| orders_fees = sorted(orders_fees, key=feekey) #sort by ascending cjfee | ||
|
|
||
| log.debug('considered orders = \n' + '\n'.join([str(o) for o in orders_fees | ||
| log.info('considered orders = \n' + '\n'.join([str(o) for o in orders_fees |
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 think keep the considered orders as debug? Seems like the class of stuff that is filling up the terminal a bit too much.
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.
Agreed.
|
Shouldn't we add to this PR the code that filters out the logging that comes out to the terminal? |
|
I've already worked on the code to filter the console messages, but from what i've researched it cant be done in the same part of the code, if it is supposed to be a config-file-option (guess you know this, but for reference: https://docs.python.org/2/howto/logging.html#logging-advanced-tutorial ). The PR I have in mind will make this more clear. |
and default to INFO for console output. Logfiles are still DEBUG.
joinmarket.cfg and default to INFO. Logsfiles still DEBUG.
|
Added the code now as well, to tweak logging to the console to INFO by default. Added this as a config option to joinmarket.cfg. Reasoning for moving the console logging initialization from support.py to configure.py: I've tested this code with YG-PE and sendpayment. Worked just fine. |
2f95d88 Implement console log level filterting. Reads option from joinmarket.cfg and default to INFO for console output. Logfiles are still DEBUG. (Alex Cato) 033662f Modify two levels as discussed in #631 (Alex Cato) 4ff5519 Change all log.debug() lines in every .py file to the appropriate log level (log.info(), log.warn() or log.error()). No changes in any program logic. DEBUG also still default log level. (Alex Cato) 03fbcfd Intended for users to better understand which log messages are relevant to them. Change all log.debug() lines in every .py file to the appropriate log level (log.debug(), log.info(), log.warn() or log.error()). No changes in any program logic. DEBUG also still default log level. (Alex Cato)
Currently, this is only intended for users to better understand which log messages are relevant to them.
Change all log.debug() lines in every .py file to the appropriate log level (log.debug(), log.info(), log.warn() or log.error()).
No changes in any program logic. DEBUG is also still default log level for both the console and logfiles.