commit 3ab8f389a17c4e9478994ea4abd0aa55ce1d3ade Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Wed Mar 5 16:56:50 2014 +0100
Move handling the logging level in the main
pkgdb2-cli | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) --- diff --git a/pkgdb2-cli b/pkgdb2-cli index c3447eb..d8b396c 100755 --- a/pkgdb2-cli +++ b/pkgdb2-cli @@ -43,12 +43,6 @@ RESET = "\033[0;0m" logging.basicConfig() pkgdblog = logging.getLogger("pkgdb") log = logging.getLogger("pkgdb-cli") -if '--debug' in sys.argv: - log.setLevel(logging.DEBUG) - pkgdblog.setLevel(logging.DEBUG) - #pkgdbclient.debug = True -elif '--verbose' in sys.argv: - log.setLevel(logging.INFO)
if '--test' in sys.argv: print "Testing environment" @@ -635,6 +629,12 @@ def main(): BOLD = "" RESET = ""
+ if arg.debug: + log.setLevel(logging.DEBUG) + pkgdblog.setLevel(logging.DEBUG) + elif arg.verbose: + log.setLevel(logging.INFO) + arg.func(arg)
packagedb-cli-commits@lists.stg.fedorahosted.org