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
daba9890
Commit
daba9890
authored
Aug 28, 2006
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced zLOG with logging to shut up a deprecation warning.
parent
d587406e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
lib/python/ZServer/utils.py
lib/python/ZServer/utils.py
+6
-7
No files found.
lib/python/ZServer/utils.py
View file @
daba9890
...
...
@@ -18,19 +18,18 @@ def getZopeVersion():
return
App
.
version_txt
.
version_txt
()
def
patchAsyncoreLogger
():
# Poke zLOG default logging into asyncore to send
# messages to zLOG instead of medusa logger
from
zLOG
import
LOG
,
register_subsystem
,
BLATHER
,
INFO
,
WARNING
,
ERROR
register_subsystem
(
'ZServer'
)
severity
=
{
'info'
:
INFO
,
'warning'
:
WARNING
,
'error'
:
ERROR
}
# Poke the Python logging module into asyncore to send
# messages to logging instead of medusa logger
from
logging
import
getLogger
logger
=
getLogger
(
'ZServer'
)
def
log_info
(
self
,
message
,
type
=
'info'
):
if
message
[:
14
]
==
'adding channel'
or
\
message
[:
15
]
==
'closing channel'
or
\
message
==
'Computing default hostname'
:
LOG
(
'ZServer'
,
BLATHER
,
message
)
logger
.
debug
(
message
)
else
:
LOG
(
'ZServer'
,
severity
[
type
],
message
)
getattr
(
logger
,
type
)(
message
)
import
asyncore
asyncore
.
dispatcher
.
log_info
=
log_info
...
...
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