Improve clarity of logging spew at high verbosity levels.

This commit is contained in:
2017-10-25 21:47:33 -07:00
parent 873fc22cfb
commit 059322b7f8
4 changed files with 31 additions and 0 deletions

View File

@@ -1,2 +1,17 @@
import logging
VERBOSITY_SOME = 1
VERBOSITY_LOTS = 2
def verbosity_to_log_level(verbosity):
'''
Given a borgmatic verbosity value, return the corresponding Python log level.
'''
return {
VERBOSITY_SOME: logging.INFO,
VERBOSITY_LOTS: logging.DEBUG,
}.get(verbosity, logging.ERROR)