You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
Currently, two functions in preupg/application.py needs to be called in order to make logging to file work: _add_debug_log_file and _add_report_log_file. There's also code changing what level of messages will be printed to STDOUT in preupg.application.py/Application.__init__().
Current logging functions:
log_warning .. this function is in module APIs, prints to STDERR, nothing else
log_message .. prints message to STDOUT and also to /var/log/preupgrade/preupg.log
logger_debug.{log,debug,error,..} .. prints message to STDOUT[*] and to /var/log/preupgrade/preupg.log
logger_report.{log,debug,error,..} .. prints message to STDOUT[*] and to /var/log/preupgrade/preupg-report.log
[*] The message is printed to STDOUT if the log level is above DEBUG. However, when --debug option is used, every message is printed to STDOUT.
This needs some refactoring:
the functions should be smarter about where to be printing the output. For example printing ERROR level message to STDOUT is not appropriate, it should be printing to STDERR. However INFO level can be printed to STDOUT.
create a function that prints the message only to a log file
The text was updated successfully, but these errors were encountered:
A good rule of thumb is, that if the purpose the command is to print something, then that something should go to stdout and everything else (anciliary output, or meta output) to stderr.
In this context, this means that log_message() should simply always log to stderr.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently, two functions in preupg/application.py needs to be called in order to make logging to file work:
_add_debug_log_file
and_add_report_log_file
. There's also code changing what level of messages will be printed to STDOUT inpreupg.application.py/Application.__init__()
.Current logging functions:
log_warning
.. this function is in module APIs, prints to STDERR, nothing elselog_message
.. prints message to STDOUT and also to /var/log/preupgrade/preupg.loglogger_debug.{log,debug,error,..}
.. prints message to STDOUT[*] and to /var/log/preupgrade/preupg.loglogger_report.{log,debug,error,..}
.. prints message to STDOUT[*] and to /var/log/preupgrade/preupg-report.log[*] The message is printed to STDOUT if the log level is above DEBUG. However, when --debug option is used, every message is printed to STDOUT.
This needs some refactoring:
The text was updated successfully, but these errors were encountered: