7 Write to /var/log/httpd/error_log. See
9 http://www.modpython.org/FAQ/faqw.py?req=edit&file=faq02.003.htp
12 def write(self, data):
13 sys.stderr.write(data)
18 def profile(callable):
20 Prints the runtime of the specified callable. Use as a decorator, e.g.,
34 result = profile(foo)(...)
37 def wrapper(*args, **kwds):
39 result = callable(*args, **kwds)
42 args += ["%s = %s" % (name, str(value)) for (name, value) in kwds.items()]
43 print >> log, "%s (%s): %f s" % (callable.__name__, ", ".join(args), end - start)
48 if __name__ == "__main__":
50 def sleep(seconds = 1):