File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,7 +199,11 @@ def alert():
199199 filepath.
200200 """
201201 if isinstance (func , string_types ):
202+ cmd = func
202203 func = shell (func )
204+ func .repr_str = "shell: {}" .format (cmd )
205+ elif func :
206+ func .repr_str = str (func )
203207
204208 self .watcher .watch (filepath , func , delay , ignore = ignore )
205209
Original file line number Diff line number Diff line change 99 :license: BSD, see LICENSE for more details.
1010"""
1111
12- import os
1312import glob
13+ import logging
14+ import os
1415import time
16+
1517try :
1618 import pyinotify
1719except ImportError :
1820 pyinotify = None
1921
22+ logger = logging .getLogger ('livereload' )
23+
2024
2125class Watcher (object ):
2226 """A file watcher registery."""
@@ -70,10 +74,13 @@ def examine(self):
7074 item = self ._tasks [path ]
7175 if self .is_changed (path , item ['ignore' ]):
7276 func = item ['func' ]
73- func and func ()
7477 delay = item ['delay' ]
7578 if delay and isinstance (delay , float ):
7679 delays .add (delay )
80+ if func :
81+ logger .info ("Running task: {} (delay: {})" .format (
82+ func .repr_str , delay ))
83+ func ()
7784
7885 if delays :
7986 delay = max (delays )
You can’t perform that action at this time.
0 commit comments