Cleaned up logging
This commit is contained in:
parent
48f3b18acd
commit
672102da6f
|
@ -40,6 +40,9 @@ def mediate_ignored(fn):
|
||||||
return wrapped
|
return wrapped
|
||||||
|
|
||||||
class BaseListener(object):
|
class BaseListener(object):
|
||||||
|
def __str__(self):
|
||||||
|
return "Listener(%s), Signal(%s)" % \
|
||||||
|
(self.__class__.__name__, self. signal)
|
||||||
def my_init(self, signal): self.signal = signal
|
def my_init(self, signal): self.signal = signal
|
||||||
|
|
||||||
class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable):
|
class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable):
|
||||||
|
|
|
@ -97,8 +97,10 @@ class Manager(Loggable):
|
||||||
Start watching 'path' using 'listener'. First will check if directory
|
Start watching 'path' using 'listener'. First will check if directory
|
||||||
is being watched before adding another watch
|
is being watched before adding another watch
|
||||||
"""
|
"""
|
||||||
self.logger.info("Adding listener '%s' to '%s'" %
|
|
||||||
( listener.__class__.__name__, path) )
|
self.logger.info("Attempting to add listener to path '%s'" % path)
|
||||||
|
self.logger.info( 'Listener: %s' % str(listener) )
|
||||||
|
|
||||||
if not self.has_watch(path):
|
if not self.has_watch(path):
|
||||||
wd = self.wm.add_watch(path, pyinotify.ALL_EVENTS, rec=True,
|
wd = self.wm.add_watch(path, pyinotify.ALL_EVENTS, rec=True,
|
||||||
auto_add=True, proc_fun=listener)
|
auto_add=True, proc_fun=listener)
|
||||||
|
|
Loading…
Reference in New Issue