It would be a very limited set of lines, I wanted to offer an easy way for the user to see a list of results that the plugin takes over a period of time, and would be hard to see just traversing their event log.
Code:
- Code: Select all
try:
indigo.server.log("Listing filter block log records:")
for filename in os.listdir(self.LogFileLoc):
log_file = open(self.LogFileLoc + filename, "r")
for line in log_file.readlines():
if "Filter block:" in line or "will not" in line: # "will not is legacy, will be depreciated"
indigo.server.log(line)
indigo.server.log("completed log output")
except Exception as e:
self.logger.error("An error occured while reading the filter log: " + str(e))