diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-03-18 17:19:44 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-03-18 17:19:44 +0100 |
commit | ce38a17893791944fb8b4f589e7ce00d79b8ced0 (patch) | |
tree | a26c992e1011cab0558efa389dee561bcf694d62 /libmproxy/script.py | |
parent | c07cd857a76db5a4d9dbfe46abc84bb6c20088f1 (diff) | |
parent | 843b2e28bc4fcadb854b4b50c2f56a67bf63866a (diff) | |
download | mitmproxy-ce38a17893791944fb8b4f589e7ce00d79b8ced0.tar.gz mitmproxy-ce38a17893791944fb8b4f589e7ce00d79b8ced0.tar.bz2 mitmproxy-ce38a17893791944fb8b4f589e7ce00d79b8ced0.zip |
Merge pull request #238 from mitmproxy/log_levels
Log Levels
Diffstat (limited to 'libmproxy/script.py')
-rw-r--r-- | libmproxy/script.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libmproxy/script.py b/libmproxy/script.py index 9638fdec..b17766e8 100644 --- a/libmproxy/script.py +++ b/libmproxy/script.py @@ -10,15 +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 eventlog flag ("-e") was passed. mitmproxy sends - output to the eventlog for display ("v" 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). """ - self._master.add_event(*args, **kwargs) + self._master.add_event(message, level) def duplicate_flow(self, f): """ |