Commit d511d7f8 authored by Jim Fulton's avatar Jim Fulton

Added a new 'reinitialize' method to the backend-logger interface to

support log-rotation. See the new stupid logger and the ZEO server
log-rotation signal handler for examples.
parent 5519c292
......@@ -139,6 +139,10 @@ with a callable object that takes 5 arguments:
traceback. If provided, then a summary of the error
is added to the detail.
The callable object can provide a reinitialize method that may be
called with no arguments to reopen the log files (if any) as part of a
log-rotation facility.
There is a default stupid logging facility that:
- swallows logging information by default,
......@@ -228,7 +232,13 @@ def log_time():
_stupid_dest=None
_stupid_severity=None
_no_stupid_log=[]
def stupid_log_write(subsystem, severity, summary, detail, error):
class stupid_log_write:
def reinitialize(self):
global _stupid_dest
_stupid_dest = None
def __call__(self, subsystem, severity, summary, detail, error):
global _stupid_dest
if _stupid_dest is None:
......@@ -274,7 +284,7 @@ def stupid_log_write(subsystem, severity, summary, detail, error):
_stupid_dest.flush()
log_write=stupid_log_write
log_write=stupid_log_write()
format_exception_only=None
def format_exception(etype,value,tb,limit=None, delimiter='\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