diff options
Diffstat (limited to 'examples/simple/logging.py')
-rw-r--r-- | examples/simple/logging.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/simple/logging.py b/examples/simple/logging.py new file mode 100644 index 00000000..ab1baf75 --- /dev/null +++ b/examples/simple/logging.py @@ -0,0 +1,12 @@ +""" +It is recommended to use `ctx.log` for logging within a script. +This goes to the event log in mitmproxy and to stdout in mitmdump. + +If you want to help us out: https://github.com/mitmproxy/mitmproxy/issues/1530 :-) +""" +from mitmproxy import ctx + + +def start(): + ctx.log.info("This is some informative text.") + ctx.log.error("This is an error.") |