OILS / deps / source.medo / uftrace / plugin.py View on Github | oilshell.org

29 lines, 15 significant
1"""
2plugin.py - test Python 3 plugin for uftrace
3"""
4
5import collections
6import os
7import sys
8
9
10def log(msg, *args):
11 if args:
12 msg = msg % args
13 print(msg, file=sys.stderr)
14
15
16def uftrace_begin(ctx):
17 log('script begin %s', ctx)
18
19
20def uftrace_entry(ctx):
21 log('function entry %s', ctx)
22
23
24def uftrace_exit(ctx):
25 log('function exit %s', ctx)
26
27
28def uftrace_end(ctx):
29 log('script end %s', ctx)