diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-07-16 10:33:50 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-07-16 10:33:50 +1200 |
commit | 49b65d2ea4418010e2fda954d9f02ecfa04e46c5 (patch) | |
tree | 23f2cadf687fa838ff1bef4061ffcb4715504749 /mitmproxy/dump.py | |
parent | 91e9016ce5af67c4f9f48ee28a9fb14736003f53 (diff) | |
download | mitmproxy-49b65d2ea4418010e2fda954d9f02ecfa04e46c5.tar.gz mitmproxy-49b65d2ea4418010e2fda954d9f02ecfa04e46c5.tar.bz2 mitmproxy-49b65d2ea4418010e2fda954d9f02ecfa04e46c5.zip |
Add a helper to translate a log level to a tier
This is in utils for now - we'll find a better home down the track.
Diffstat (limited to 'mitmproxy/dump.py')
-rw-r--r-- | mitmproxy/dump.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/dump.py b/mitmproxy/dump.py index 70c9bb53..b95d2627 100644 --- a/mitmproxy/dump.py +++ b/mitmproxy/dump.py @@ -15,6 +15,7 @@ from mitmproxy import exceptions from mitmproxy import filt from mitmproxy import flow from mitmproxy import builtins +from mitmproxy import utils from netlib import human from netlib import tcp from netlib import strutils @@ -114,8 +115,7 @@ class DumpMaster(flow.FlowMaster): raise DumpError(str(e)) def add_log(self, e, level="info"): - needed = dict(error=0, warn=1, info=2, debug=3).get(level, 2) - if self.options.verbosity >= needed: + if self.options.verbosity >= utils.log_tier(level): self.echo( e, fg="red" if level == "error" else None, |