Skip to content

Commit

Permalink
added FilelogHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
zopyx committed Sep 16, 2005
1 parent 469ef76 commit 5bee612
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ProgressHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,16 @@ class ZLogHandler(StdoutHandler):
def output(self, 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')

0 comments on commit 5bee612

Please sign in to comment.