Fix logging to stdout and file in classes/commands
Fix logging to console to depend on input CLI args. By default, keep
logging to stdout. Make --log-file argument working as well.
Use the input verbosity parameters as a controlling switch for
logs verbosity.
Evaluate log levels as:
* 1 (WARNING+) - the default log level if neither -v nor --debug used
* 2 (INFO+) - applies if -v / --verbose
* 4 (DEBUG+) - applies if --debug, dumps command results to file,
if --log-file is requested.
* 5 (DEBUG+) - applies if --debug and -v. Like the latter mode, but
also dumps the executed commands results to console.
This is needed for better deployments troubleshootng.
Reviewed: https:/ /review. opendev. org/702434 /git.openstack. org/cgit/ openstack/ paunch/ commit/ ?id=059aa8c1f66 337bc927db7aefd e5639fc70ecf5f
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit 059aa8c1f66337b c927db7aefde563 9fc70ecf5f
Author: Bogdan Dobrelya <email address hidden>
Date: Mon Oct 22 12:22:10 2018 +0200
Fix logging to stdout and file in classes/commands
Fix logging to console to depend on input CLI args. By default, keep
logging to stdout. Make --log-file argument working as well.
Use the input verbosity parameters as a controlling switch for
logs verbosity.
Evaluate log levels as:
* 1 (WARNING+) - the default log level if neither -v nor --debug used
* 2 (INFO+) - applies if -v / --verbose
* 4 (DEBUG+) - applies if --debug, dumps command results to file,
if --log-file is requested.
* 5 (DEBUG+) - applies if --debug and -v. Like the latter mode, but
also dumps the executed commands results to console.
This is needed for better deployments troubleshootng.
Closes-Bug: #1799182
Change-Id: I653ac4cc520e40 f3eb4d029e8c99a b482b17a859 6713c7b5f7bb341 28f39aae24)
Signed-off-by: Bogdan Dobrelya <email address hidden>
(cherry picked from commit d3c83259bfe59ed