aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/log.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2018-02-26 08:56:23 +1300
committerAldo Cortesi <aldo@corte.si>2018-02-26 09:02:24 +1300
commit2fb85553cc57e9559ed6ea747b3043b6f87bf36e (patch)
tree22785f82fa11899117712b3fa489f7abb091f043 /mitmproxy/log.py
parent77e5d823e0e7cb2032e639de315d49bcad1945cc (diff)
downloadmitmproxy-2fb85553cc57e9559ed6ea747b3043b6f87bf36e.tar.gz
mitmproxy-2fb85553cc57e9559ed6ea747b3043b6f87bf36e.tar.bz2
mitmproxy-2fb85553cc57e9559ed6ea747b3043b6f87bf36e.zip
Revamp verbosity options
Split verbosity into termlog_verbosity and console_eventlog_verbosity. This patch also removes printing to console if there are unknown options in the command-line. Options now live in separate addons, so having uknown options remaining is common and expected. We definitely shoould have some other way for users to see what was ignored so they can catch typos and the like, but that's a different patch.
Diffstat (limited to 'mitmproxy/log.py')
-rw-r--r--mitmproxy/log.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mitmproxy/log.py b/mitmproxy/log.py
index 3083a000..d2988011 100644
--- a/mitmproxy/log.py
+++ b/mitmproxy/log.py
@@ -57,5 +57,14 @@ class Log:
self.master.add_log(text, level)
+LogTierOrder = [
+ "error",
+ "warn",
+ "info",
+ "alert",
+ "debug",
+]
+
+
def log_tier(level):
return dict(error=0, warn=1, info=2, alert=2, debug=3).get(level)