[Zope-Checkins] CVS: Zope/ZServer/medusa - logger.py:1.13.24.1
Andreas Jung
andreas@digicool.com
Wed, 23 Jan 2002 13:42:19 -0500
Update of /cvs-repository/Zope/ZServer/medusa
In directory cvs.zope.org:/tmp/cvs-serv6428/ZServer/medusa
Modified Files:
Tag: chrism_logrotate_branch
logger.py
Log Message:
added reopen()
=== Zope/ZServer/medusa/logger.py 1.13 => 1.13.24.1 ===
# pass this either a path or a file object.
def __init__ (self, file, flush=1, mode='a'):
+ self.filename = None
if type(file) == type(''):
if (file == '-'):
import sys
self.file = sys.stdout
else:
+ self.filename = file
self.file = open (file, mode)
else:
self.file = file
self.do_flush = flush
+
+
+ def reopen(self):
+
+ if self.filename:
+ self.file.close()
+ self.file = open(file,'a')
+
def __repr__ (self):
return '<file logger: %s>' % self.file