diff options
Diffstat (limited to 'voctocore/voctocore.py')
-rwxr-xr-x | voctocore/voctocore.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/voctocore/voctocore.py b/voctocore/voctocore.py index 221291c..2f60f72 100755 --- a/voctocore/voctocore.py +++ b/voctocore/voctocore.py @@ -59,9 +59,19 @@ def main(): # configure logging docolor = (Args.color == 'always') or (Args.color == 'auto' and sys.stderr.isatty()) - logging.basicConfig( - level=logging.DEBUG if Args.verbose else logging.WARNING, - format='\x1b[33m%(levelname)8s\x1b[0m \x1b[32m%(name)s\x1b[0m: %(message)s' if docolor else '%(levelname)8s %(name)s: %(message)s') + if Args.verbose == 2: + level = logging.DEBUG + elif Args.verbose == 1: + level = logging.INFO + else: + level = logging.WARNING + + if docolor: + format = '\x1b[33m%(levelname)8s\x1b[0m \x1b[32m%(name)s\x1b[0m: %(message)s' + else: + format = '%(levelname)8s %(name)s: %(message)s' + + logging.basicConfig(level=level, format=format) # make killable by ctrl-c logging.debug('setting SIGINT handler') |