]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-13585] Own logging format for the log file output with timestamp when the
authorMartin Palma <martin@palma.bz>
Tue, 24 Nov 2015 16:24:02 +0000 (17:24 +0100)
committerMartin Palma <martin@palma.bz>
Tue, 24 Nov 2015 16:24:02 +0000 (17:24 +0100)
LogRecord was created.

Removed obsolete timestamp replacement.

Signed-off-by: Martin Palma <martin@palma.bz>
ceph_deploy/util/log.py

index 1d27984d55b6d5f256eee7d136d1d656b1d152e3..c72303c9df83ba900eeaf2f058cbc20959229e12 100644 (file)
@@ -1,6 +1,5 @@
 import logging
 import sys
-import datetime
 
 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
 
@@ -18,8 +17,8 @@ COLOR_SEQ = "\033[1;%dm"
 BOLD_SEQ = "\033[1m"
 
 BASE_COLOR_FORMAT = "[$BOLD%(name)s$RESET][%(color_levelname)-17s] %(message)s"
-BASE_FORMAT = "[%(timestamp)s][%(name)s][%(levelname)-6s] %(message)s"
-
+BASE_FORMAT = "[%(name)s][%(levelname)-6s] %(message)s"
+FILE_FORMAT = "[%(asctime)s]" + BASE_FORMAT
 
 def supports_color():
     """
@@ -54,7 +53,6 @@ class ColoredFormatter(logging.Formatter):
         truncated_level = record.levelname[:6]
         levelname_color = COLOR_SEQ % (30 + COLORS[levelname]) + truncated_level + RESET_SEQ
         record.color_levelname = levelname_color
-        record.timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
         return logging.Formatter.format(self, record)