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
82bce9ba
Commit
82bce9ba
authored
Apr 13, 2004
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add BaseLogger to ZServer, since this is now the only place it is used
parent
9764267f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
6 deletions
+41
-6
lib/python/ZServer/AccessLogger.py
lib/python/ZServer/AccessLogger.py
+8
-4
lib/python/ZServer/BaseLogger.py
lib/python/ZServer/BaseLogger.py
+30
-0
lib/python/ZServer/DebugLogger.py
lib/python/ZServer/DebugLogger.py
+3
-2
No files found.
lib/python/ZServer/AccessLogger.py
View file @
82bce9ba
...
@@ -16,13 +16,17 @@ A logging module which handles ZServer access log messages.
...
@@ -16,13 +16,17 @@ A logging module which handles ZServer access log messages.
This depends on Vinay Sajip's PEP 282 logging module.
This depends on Vinay Sajip's PEP 282 logging module.
"""
"""
import
logging
from
zLOG.BaseLogger
import
BaseLogger
from
ZServer.BaseLogger
import
BaseLogger
class
AccessLogger
(
BaseLogger
):
class
AccessLogger
(
BaseLogger
):
logger
=
logging
.
getLogger
(
'access'
)
def
__init__
(
self
):
BaseLogger
.
__init__
(
self
,
'access'
)
def
log
(
self
,
message
):
def
log
(
self
,
message
):
if
not
self
.
logger
.
handlers
:
# dont log if we have no handlers
if
not
self
.
logger
.
handlers
:
# don
'
t log if we have no handlers
return
return
if
message
.
endswith
(
'
\
n
'
):
if
message
.
endswith
(
'
\
n
'
):
message
=
message
[:
-
1
]
message
=
message
[:
-
1
]
...
...
lib/python/ZServer/BaseLogger.py
0 → 100644
View file @
82bce9ba
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""
An abstract logger meant to provide features to the access logger,
the event logger, and the debug logger.
"""
import
logging
class
BaseLogger
:
def
__init__
(
self
,
name
):
self
.
logger
=
logging
.
getLogger
(
name
)
self
.
logger
.
propagate
=
False
def
reopen
(
self
):
for
handler
in
self
.
logger
.
handlers
:
if
hasattr
(
handler
,
'reopen'
)
and
callable
(
handler
.
reopen
):
handler
.
reopen
()
lib/python/ZServer/DebugLogger.py
View file @
82bce9ba
...
@@ -36,12 +36,13 @@ where:
...
@@ -36,12 +36,13 @@ where:
import
time
import
time
import
logging
import
logging
from
zLOG
.BaseLogger
import
BaseLogger
from
ZServer
.BaseLogger
import
BaseLogger
class
DebugLogger
(
BaseLogger
):
class
DebugLogger
(
BaseLogger
):
logger
=
logging
.
getLogger
(
'trace'
)
def
__init__
(
self
):
BaseLogger
.
__init__
(
self
,
'trace'
)
def
log
(
self
,
code
,
request_id
,
data
=
''
):
def
log
(
self
,
code
,
request_id
,
data
=
''
):
if
not
self
.
logger
.
handlers
:
if
not
self
.
logger
.
handlers
:
...
...
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