[Zope-Checkins]
SVN: Zope/branches/2.9/lib/python/Signals/SignalHandler.py
removed zLOG dependency
Andreas Jung
andreas at andreas-jung.com
Sat Jun 24 10:21:26 EDT 2006
Log message for revision 68825:
removed zLOG dependency
Changed:
U Zope/branches/2.9/lib/python/Signals/SignalHandler.py
-=-
Modified: Zope/branches/2.9/lib/python/Signals/SignalHandler.py
===================================================================
--- Zope/branches/2.9/lib/python/Signals/SignalHandler.py 2006-06-24 12:51:46 UTC (rev 68824)
+++ Zope/branches/2.9/lib/python/Signals/SignalHandler.py 2006-06-24 14:21:26 UTC (rev 68825)
@@ -16,8 +16,11 @@
__version__='$Revision: 1.2 $'[11:-2]
import sys, os
-import signal, zLOG
+import signal
+import logging
+LOG = logging.getLogger('Signals')
+
class SignalHandler:
def __init__(self):
@@ -36,9 +39,8 @@
items = self.registry[signum] = []
signal.signal(signum, self.signalHandler)
signame = get_signal_name(signum)
- zLOG.LOG('Z2', zLOG.BLATHER, "Installed sighandler for %s" % (
- signame
- ))
+ LOG.debug("Installed sighandler for %s" % signame)
+
items.insert(0, handler)
def getRegisteredSignals(self):
@@ -49,7 +51,7 @@
def signalHandler(self, signum, frame):
"""Meta signal handler that dispatches to registered handlers."""
signame = get_signal_name(signum)
- zLOG.LOG('Z2', zLOG.INFO , "Caught signal %s" % signame)
+ LOG.info("Caught signal %s" % signame)
for handler in self.registry.get(signum, []):
# Never let a bad handler prevent the standard signal
@@ -59,9 +61,7 @@
# if we trap SystemExit, we can't restart
raise
except:
- zLOG.LOG('Z2', zLOG.WARNING,
- 'A handler for %s failed!' % signame,
- error=sys.exc_info())
+ LOG.warn('A handler for %s failed!' % signame, exc_info=sys.exc_info())
_signals = None
More information about the Zope-Checkins
mailing list