add time to the beginning of each log message

This commit is contained in:
Seth Schoen 2012-11-18 22:24:12 -08:00
parent e3dbe1a60f
commit bcf842e265

View file

@ -2,7 +2,7 @@
# This daemon runs on the CA side to handle logging.
import redis, signal, sys
import redis, signal, sys, time
r = redis.Redis()
ps = r.pubsub()
@ -20,7 +20,7 @@ for message in ps.listen():
if message["type"] != "message":
continue
if message["channel"] == "logs":
sys.stdout.write(message["data"] + "\n")
sys.stdout.write(time.ctime() + " " + message["data"] + "\n")
sys.stdout.flush()
continue
if message["channel"] == "exit":