Limit argument range for --verbose, make default log level more explicit. (#93)

This commit was merged in pull request #93.
This commit is contained in:
2018-09-18 05:31:27 +00:00
committed by Gitea
parent e7b128e735
commit a836ec944f
3 changed files with 7 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import logging
VERBOSITY_WARNING = 0
VERBOSITY_SOME = 1
VERBOSITY_LOTS = 2
@@ -10,6 +11,7 @@ def verbosity_to_log_level(verbosity):
Given a borgmatic verbosity value, return the corresponding Python log level.
'''
return {
VERBOSITY_WARNING: logging.WARNING,
VERBOSITY_SOME: logging.INFO,
VERBOSITY_LOTS: logging.DEBUG,
}.get(verbosity, logging.WARNING)