logging doesn't work with deluge-console because of ncurses
Deluge uses the Python "logging" module for warnings, errors, and debugging statements. By default, the logging module outputs everything to stderr (or stdout?). But this does not work with deluge-console, because it is using ncurses. Anything written to stdout or stderr will not print out correctly when using a program written in ncurses.
(All the debugging statements do work correctly when using deluge-console and logging to a file instead of the terminal.)
I've come up with a couple different solutions to this.
- Error out when the user tries to run deluge-console with a log level above "none" and does not specify a logfile.
- Buffer all the logging output and print it to the console right before deluge-console closes. (After stdscr.endwin() is called.)
- Write a wrapper around the LOG object (from deluge.log) that creates an event every time something is output to the log. Then deluge-console can catch this event and print the log message just like its own output (within its own terminal). The only downside of this is that there could be no use of log.error() or log.debug() or similar functions within the functions that print to the terminal in deluge-console. This includes ConsoleUI.write() and Screen.addline().
I would be willing to work on implementing any of these, but I don't want to start work on something that definitely won't be accepted.
Change History
(6)
Owner: |
set to nick
|
Status: |
new → assigned
|
Milestone: |
1.4.0 → Future
|
Resolution: |
→ Fixed
|
Status: |
assigned → closed
|
Fixed in develop: [64da09675]