Added redirect_err() for easier debugging.
[drlaunch] / src / drlaunch_widget.py
index 54ad48c..e5e27bf 100755 (executable)
@@ -27,6 +27,16 @@ from drlaunch import widget
 class DrlaunchPlugin(widget.DrlaunchPlugin):
     pass
 
+def redirect_err():
+    import sys
+    import time
+
+    print "Opening /tmp/drlaunch.log"
+    f=open('/tmp/drlaunch.log', 'at', buffering=1)
+    sys.stdout=f
+    sys.stderr=f
+    print "Log open:", time.ctime()
+
 hd_plugin_type = DrlaunchPlugin
 
 if __name__=="__main__":