Browse Source

batcave: add --verbose flag to increase log verbosity

Helge Jung 10 years ago
parent
commit
65111f3e86
1 changed files with 2 additions and 1 deletions
  1. 2 1
      batcave.py

+ 2 - 1
batcave.py

@@ -15,6 +15,7 @@ DEFAULT_INTERVAL = 15
 parser = argparse.ArgumentParser(description='Batman/Alfred Transmission Collection, Aggregation & Value Engine')
 parser.add_argument('--logfile', help='path for log file')
 parser.add_argument('--interval', type=int, default=DEFAULT_INTERVAL, help='data poll interval')
+parser.add_argument('-v', '--verbose', action='store_true', help='increase output verbosity')
 parser.add_argument('-d', '--no-detach', action='store_true', help='Don\'t detach (daemonize) ourself')
 parser.add_argument('-n', '--no-send', action='store_true', help='Fetch data but don\'t send it')
 parser.add_argument('-A', '--alfred-json', help='executable path for alfred-json')
@@ -34,7 +35,7 @@ if args.interval < 5:
 shall_daemonize = not args.no_detach
 
 logger = logging.getLogger()
-logger.setLevel(logging.DEBUG)
+logger.setLevel(logging.DEBUG if args.verbose else logging.INFO)
 
 if not args.logfile is None:
 	fh = logging.FileHandler(args.logfile)