Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
3e92bb2d
Commit
3e92bb2d
authored
Jan 08, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zLOG -> logging
parent
bb178344
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
lib/python/Signals/SignalHandler.py
lib/python/Signals/SignalHandler.py
+8
-8
No files found.
lib/python/Signals/SignalHandler.py
View file @
3e92bb2d
...
...
@@ -16,7 +16,10 @@
__version__
=
'$Revision: 1.2 $'
[
11
:
-
2
]
import
sys
,
os
import
signal
,
zLOG
import
signal
from
logging
import
getLogger
LOG
=
getLogger
(
'SignalHandler'
)
class
SignalHandler
:
...
...
@@ -36,9 +39,7 @@ class SignalHandler:
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 +50,7 @@ class SignalHandler:
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 +60,8 @@ class SignalHandler:
# 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment