X-Git-Url: http://git.maemo.org/git/?p=profile-appoint;a=blobdiff_plain;f=debug.py;fp=debug.py;h=16c7db29681bc6abba7279f8e5bb1cb1ec7f9178;hp=0000000000000000000000000000000000000000;hb=c0b4e4bd7424ac8e2eccce0203a9b7b2bb6cb57a;hpb=79f04b08cf7517ef4045198e1557cd44740e7ae2 diff --git a/debug.py b/debug.py new file mode 100755 index 0000000..16c7db2 --- /dev/null +++ b/debug.py @@ -0,0 +1,20 @@ +import os,time + +if os.path.exists("/tmp/switch.debug"): +if True: + enable_logging = True +else: + enable_logging = False + +if enable_logging and not 'fd' in locals(): + fd = open('/tmp/switch.log','w+') +else: + fd = None + +def debug(*input): + if enable_logging: + now = str(time.time()) + print now+str(input) + print >>fd,now+str(input) + fd.flush() +