Displaying the time when js shift watcher finds changes
authorFrederic Massart <fred@moodle.com>
Fri, 1 Aug 2014 05:38:51 +0000 (13:38 +0800)
committerFrederic Massart <fred@moodle.com>
Fri, 1 Aug 2014 05:38:51 +0000 (13:38 +0800)
mdk/commands/js.py

index 6401218..67b891a 100644 (file)
@@ -25,6 +25,7 @@ http://github.com/FMCorz/mdk
 import logging
 import os
 import time
+import datetime
 import watchdog.events
 import watchdog.observers
 from ..command import Command
@@ -178,6 +179,6 @@ class JsShiftWatcher(watchdog.events.FileSystemEventHandler):
         elif not os.path.splitext(event.src_path)[1] in self._ext:
             return
 
-        logging.info('[%s] Changes detected!' % (self._M.get('identifier')))
+        logging.info('[%s] (%s) Changes detected!' % (self._M.get('identifier'), datetime.datetime.now().strftime('%H:%M:%S')))
         # How about handling exceptions here?
         self._processor.shift(**self._args)