From ffd078a652b468ad3087bfa52e973a19f6766b9e Mon Sep 17 00:00:00 2001 From: Leho Kraav Date: Tue, 18 Aug 2009 13:33:57 +0200 Subject: dprint() now timestamps debug messages it's good to know when exactly a problem occurs. [ mv: minor rewording of the commit message and filter pointless mode change ] --- skype/skyped.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skype/skyped.py b/skype/skyped.py index 254ff67f..806dd983 100644 --- a/skype/skyped.py +++ b/skype/skyped.py @@ -139,13 +139,16 @@ def listener(sock, *args): return False def dprint(msg): + from time import strftime global options + now = strftime("%Y-%m-%d %H:%M:%S") + if options.debug: - print msg + print now + ": " + msg if options.log: sock = open(options.log, "a") - sock.write("%s\n" % msg) + sock.write("%s: %s\n" % now, msg) sock.close() class SkypeApi: -- cgit v1.2.3