try to improve php logging; set error_log in the right section of the .ini; enable...
[myplc.git] / bin / refresh-peer.py
index c5fa748..5249e89 100644 (file)
@@ -4,22 +4,27 @@ import sys,time,os,os.path
 
 logdir="/var/log/peers"
 
+#
+# WARNING: the bulk of this output now goes into
+# /var/log/plcapi.log 
+#
+
 def Run (peername):
     timestring=time.strftime("%Y-%m-%d-%H-%M-%S")
-    print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',peername
-    print 'RefreshPeer on %s - starting on %s'%(peername,timestring)
-    print 'xxxxxxxxxx'
+    print('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',peername)
+    print('RefreshPeer on %s - starting on %s'%(peername,timestring))
+    print('xxxxxxxxxx')
     sys.stdout.flush()
     start=time.time()
     result=RefreshPeer(peername)
     finish=time.time()
 
-    print 'Total duration',finish-start
-    print 'xxxxxxxxxx timers:'
-    keys=result.keys()
+    print('Total duration',finish-start)
+    print('xxxxxxxxxx timers:')
+    keys=list(result.keys())
     keys.sort()
     for key in keys:
-        print key,result[key]
+        print(key,result[key])
     sys.stdout.flush()
     sys.stderr.flush()