Commit 879f6d05 authored by Andreas Jung's avatar Andreas Jung

added FilelogHandler

parent c17f27d8
...@@ -95,3 +95,17 @@ class ZLogHandler(StdoutHandler): ...@@ -95,3 +95,17 @@ class ZLogHandler(StdoutHandler):
def output(self, text): def output(self, text):
LOG(self._ident, INFO, text) LOG(self._ident, INFO, text)
class FilelogHandler(StdoutHandler):
""" Use a custom file for logging """
__implements__ = IProgressHandler
def __init__(self, filename, steps=100):
StdoutHandler.__init__(self, steps)
self.filename = filename
def output(self, text):
open(self.filename, 'a').write(text + '\n')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment