curtail some bothering continuously repeatable debug messages of filters (backend-related) to level 4 (below extra heavy-debug, so simplifying debugging and testing with level 5)

pull/2517/head
sebres 2019-08-22 21:17:45 +02:00
parent 16b3993be6
commit 65da15327e
3 changed files with 6 additions and 6 deletions

View File

@ -64,7 +64,7 @@ class FilterGamin(FileFilter):
logSys.debug("Created FilterGamin") logSys.debug("Created FilterGamin")
def callback(self, path, event): def callback(self, path, event):
logSys.debug("Got event: " + repr(event) + " for " + path) logSys.log(4, "Got event: " + repr(event) + " for " + path)
if event in (gamin.GAMCreated, gamin.GAMChanged, gamin.GAMExists): if event in (gamin.GAMCreated, gamin.GAMChanged, gamin.GAMExists):
logSys.debug("File changed: " + path) logSys.debug("File changed: " + path)
self.__modified = True self.__modified = True

View File

@ -98,8 +98,8 @@ class FilterPoll(FileFilter):
def run(self): def run(self):
while self.active: while self.active:
try: try:
if logSys.getEffectiveLevel() <= 6: if logSys.getEffectiveLevel() <= 4:
logSys.log(6, "Woke up idle=%s with %d files monitored", logSys.log(4, "Woke up idle=%s with %d files monitored",
self.idle, self.getLogCount()) self.idle, self.getLogCount())
if self.idle: if self.idle:
if not Utils.wait_for(lambda: not self.active or not self.idle, if not Utils.wait_for(lambda: not self.active or not self.idle,
@ -140,10 +140,10 @@ class FilterPoll(FileFilter):
logStats = os.stat(filename) logStats = os.stat(filename)
stats = logStats.st_mtime, logStats.st_ino, logStats.st_size stats = logStats.st_mtime, logStats.st_ino, logStats.st_size
pstats = self.__prevStats.get(filename, (0)) pstats = self.__prevStats.get(filename, (0))
if logSys.getEffectiveLevel() <= 5: if logSys.getEffectiveLevel() <= 4:
# we do not want to waste time on strftime etc if not necessary # we do not want to waste time on strftime etc if not necessary
dt = logStats.st_mtime - pstats[0] dt = logStats.st_mtime - pstats[0]
logSys.log(5, "Checking %s for being modified. Previous/current stats: %s / %s. dt: %s", logSys.log(4, "Checking %s for being modified. Previous/current stats: %s / %s. dt: %s",
filename, pstats, stats, dt) filename, pstats, stats, dt)
# os.system("stat %s | grep Modify" % filename) # os.system("stat %s | grep Modify" % filename)
self.__file404Cnt[filename] = 0 self.__file404Cnt[filename] = 0

View File

@ -87,7 +87,7 @@ class FilterPyinotify(FileFilter):
logSys.debug("Created FilterPyinotify") logSys.debug("Created FilterPyinotify")
def callback(self, event, origin=''): def callback(self, event, origin=''):
logSys.log(7, "[%s] %sCallback for Event: %s", self.jailName, origin, event) logSys.log(4, "[%s] %sCallback for Event: %s", self.jailName, origin, event)
path = event.pathname path = event.pathname
# check watching of this path: # check watching of this path:
isWF = False isWF = False