verbosity.py 320 B

123456789101112131415
  1. import logging
  2. VERBOSITY_SOME = 1
  3. VERBOSITY_LOTS = 2
  4. def verbosity_to_log_level(verbosity):
  5. '''
  6. Given a borgmatic verbosity value, return the corresponding Python log level.
  7. '''
  8. return {
  9. VERBOSITY_SOME: logging.INFO,
  10. VERBOSITY_LOTS: logging.DEBUG,
  11. }.get(verbosity, logging.ERROR)