From bc1f5f53a1556dffc960d0725ae12eb0b3bef19c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 15 May 2020 11:01:38 +0000 Subject: [PATCH] Add quiet mode Signed-off-by: Michael Tremer --- src/python/location-downloader.in | 6 +++++- src/python/location-exporter.in | 6 +++++- src/python/location-importer.in | 6 +++++- src/python/location-query.in | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/python/location-downloader.in b/src/python/location-downloader.in index f1d38f1..ce3c85d 100644 --- a/src/python/location-downloader.in +++ b/src/python/location-downloader.in @@ -219,6 +219,8 @@ class CLI(object): # Global configuration flags parser.add_argument("--debug", action="store_true", help=_("Enable debug output")) + parser.add_argument("--quiet", action="store_true", + help=_("Enable quiet mode")) # version parser.add_argument("--version", action="version", @@ -245,9 +247,11 @@ class CLI(object): args = parser.parse_args() - # Enable debug logging + # Configure logging if args.debug: location.logger.set_level(logging.DEBUG) + elif args.quiet: + location.logger.set_level(logging.WARNING) # Print usage if no action was given if not "func" in args: diff --git a/src/python/location-exporter.in b/src/python/location-exporter.in index 634b862..894bb44 100644 --- a/src/python/location-exporter.in +++ b/src/python/location-exporter.in @@ -197,6 +197,8 @@ class CLI(object): # Global configuration flags parser.add_argument("--debug", action="store_true", help=_("Enable debug output")) + parser.add_argument("--quiet", action="store_true", + help=_("Enable quiet mode")) # version parser.add_argument("--version", action="version", @@ -222,9 +224,11 @@ class CLI(object): args = parser.parse_args() - # Enable debug logging + # Configure logging if args.debug: location.logger.set_level(logging.DEBUG) + elif args.quiet: + location.logger.set_level(logging.WARNING) return args diff --git a/src/python/location-importer.in b/src/python/location-importer.in index 45cacad..2ba4eb2 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -45,6 +45,8 @@ class CLI(object): # Global configuration flags parser.add_argument("--debug", action="store_true", help=_("Enable debug output")) + parser.add_argument("--quiet", action="store_true", + help=_("Enable quiet mode")) # version parser.add_argument("--version", action="version", @@ -91,9 +93,11 @@ class CLI(object): args = parser.parse_args() - # Enable debug logging + # Configure logging if args.debug: location.logger.set_level(logging.DEBUG) + elif args.quiet: + location.logger.set_level(logging.WARNING) # Print usage if no action was given if not "func" in args: diff --git a/src/python/location-query.in b/src/python/location-query.in index 85d1cbf..c138644 100644 --- a/src/python/location-query.in +++ b/src/python/location-query.in @@ -121,6 +121,8 @@ class CLI(object): # Global configuration flags parser.add_argument("--debug", action="store_true", help=_("Enable debug output")) + parser.add_argument("--quiet", action="store_true", + help=_("Enable quiet mode")) # version parser.add_argument("--version", action="version", @@ -204,9 +206,11 @@ class CLI(object): args = parser.parse_args() - # Enable debug logging + # Configure logging if args.debug: location.logger.set_level(logging.DEBUG) + elif args.quiet: + location.logger.set_level(logging.WARNING) # Print usage if no action was given if not "func" in args: -- 2.39.2