Add timestamp to log entries.

master
q3k 2013-04-25 14:37:01 +02:00
parent 8e37d5e92d
commit 6d6f54d5dd
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@
import os
import sys
import argparse
import time
import adsl
@ -48,6 +49,8 @@ def doublefork(pidfile, logfile):
self.stream = stream
def write(self, data):
timestamp = time.strftime("[%d/%m/%Y %H:%M:%S] ")
self.stream.write(timestamp)
self.stream.write(data)
self.stream.flush()