aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/script.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-03-13 01:04:45 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-03-13 01:04:45 +0100
commit4d9799f1037b46fe610b875bd2dd8aacb8966ec9 (patch)
tree1962efe758a496fcc924b1a7eb2eb599496c4d65 /libmproxy/script.py
parent7e86744226cc881507bc6c6931316b6b73ed03ec (diff)
downloadmitmproxy-4d9799f1037b46fe610b875bd2dd8aacb8966ec9.tar.gz
mitmproxy-4d9799f1037b46fe610b875bd2dd8aacb8966ec9.tar.bz2
mitmproxy-4d9799f1037b46fe610b875bd2dd8aacb8966ec9.zip
add support for log levels
Diffstat (limited to 'libmproxy/script.py')
-rw-r--r--libmproxy/script.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/libmproxy/script.py b/libmproxy/script.py
index bafa8ba9..b17766e8 100644
--- a/libmproxy/script.py
+++ b/libmproxy/script.py
@@ -10,16 +10,15 @@ class ScriptContext:
def __init__(self, master):
self._master = master
- def log(self, *args, **kwargs):
+ def log(self, message, level="info"):
"""
Logs an event.
- How this is handled depends on the front-end. mitmdump will display
- events if the v flag ("-e") was passed. mitmproxy sends
- output to the eventlog for display ("e" keyboard shortcut).
+ By default, only events with level "error" get displayed. This can be controlled with the "-v" switch.
+ How log messages are handled depends on the front-end. mitmdump will print them to stdout,
+ mitmproxy sends output to the eventlog for display ("e" keyboard shortcut).
"""
- #FIXME refactor_loglevel
- self._master.add_event(*args, **kwargs)
+ self._master.add_event(message, level)
def duplicate_flow(self, f):
"""