Skip to content

Commit

Permalink
Add min(debug_level, 2)
Browse files Browse the repository at this point in the history
So that 3 v's e.g. `-vvv` would not cause a KeyError, and default to logging.DEBUG
  • Loading branch information
KevinHock committed Jul 31, 2018
1 parent 8c2d022 commit 0b27002
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion detect_secrets/core/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def _set_debug_level(self, debug_level):
2: logging.DEBUG,
}

self.setLevel(mapping[debug_level])
self.setLevel(
mapping[min(debug_level, 2)],
)


log = get_logger()

0 comments on commit 0b27002

Please sign in to comment.