fix timestamp in logfile uncorrected with 'EDT'
authorHuanhuan Li <huanhuanx.li@intel.com>
Mon, 22 Oct 2012 19:06:58 +0000 (15:06 -0400)
committerGui Chen <gui.chen@intel.com>
Wed, 12 Dec 2012 11:33:44 +0000 (19:33 +0800)
mic/msger.py

index 5deb6bb..03de73b 100644 (file)
@@ -41,8 +41,6 @@ ERR_COLOR  = 31 # red
 ASK_COLOR  = 34 # blue
 NO_COLOR = 0
 
-HOST_TIMEZONE = time.timezone
-
 PREFIX_RE = re.compile('^<(.*?)>\s*(.*)', re.S)
 
 INTERACTIVE = True
@@ -89,9 +87,7 @@ def _general_print(head, color, msg = None, stream = None, level = 'normal'):
     # append normal msg to LOG
     save_msg = msg.strip() if msg else None
     if save_msg:
-        global HOST_TIMEZONE
-        timestr = time.strftime("[%m/%d %H:%M:%S] ",
-                                time.gmtime(time.time() - HOST_TIMEZONE))
+        timestr = time.strftime("[%m/%d %H:%M:%S] ", time.localtime())
         LOG_CONTENT += timestr + save_msg + '\n'
 
     if errormsg: