[Zope3-checkins] CVS: Zope3/src/zope/server/logger - filelogger.py:1.2.26.1 resolvinglogger.py:1.2.26.1 rotatingfilelogger.py:1.2.26.1 socketlogger.py:1.2.26.1 sysloglogger.py:1.3.10.1 taillogger.py:1.2.26.1 unresolvinglogger.py:1.2.26.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:27:30 -0400
Update of /cvs-repository/Zope3/src/zope/server/logger
In directory cvs.zope.org:/tmp/cvs-serv28993/src/zope/server/logger
Modified Files:
Tag: cw-mail-branch
filelogger.py resolvinglogger.py rotatingfilelogger.py
socketlogger.py sysloglogger.py taillogger.py
unresolvinglogger.py
Log Message:
Synced up with HEAD
=== Zope3/src/zope/server/logger/filelogger.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/server/logger/filelogger.py:1.2 Wed Dec 25 09:15:27 2002
+++ Zope3/src/zope/server/logger/filelogger.py Sun Jun 22 10:26:59 2003
@@ -18,12 +18,13 @@
from types import StringType
from zope.server.interfaces.logger import IMessageLogger
+from zope.interface import implements
class FileLogger:
"""Simple File Logger
"""
- __implements__ = IMessageLogger
+ implements(IMessageLogger)
def __init__(self, file, flush=1, mode='a'):
"""pass this either a path or a file object."""
@@ -37,26 +38,21 @@
self.file = file
self.do_flush = flush
-
def __repr__(self):
return '<file logger: %s>' % self.file
-
def write(self, data):
self.file.write(data)
self.maybe_flush()
-
def writeline(self, line):
self.file.writeline(line)
self.maybe_flush()
-
def writelines(self, lines):
self.file.writelines(lines)
self.maybe_flush()
-
def maybe_flush(self):
if self.do_flush:
self.file.flush()
@@ -66,7 +62,6 @@
def softspace(self, *args):
pass
-
def logMessage(self, message):
'See IMessageLogger'
=== Zope3/src/zope/server/logger/resolvinglogger.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/server/logger/resolvinglogger.py:1.2 Wed Dec 25 09:15:27 2002
+++ Zope3/src/zope/server/logger/resolvinglogger.py Sun Jun 22 10:26:59 2003
@@ -16,6 +16,7 @@
$Id$
"""
from zope.server.interfaces.logger import IRequestLogger
+from zope.interface import implements
class ResolvingLogger:
@@ -23,13 +24,12 @@
resolved hostname in front of the message. The message will not
be logged until the PTR request finishes (or fails)."""
- __implements__ = IRequestLogger
+ implements(IRequestLogger)
def __init__(self, resolver, logger):
self.resolver = resolver
# logger is an IMessageLogger
self.logger = logger
-
class logger_thunk:
def __init__(self, message, logger):
=== Zope3/src/zope/server/logger/rotatingfilelogger.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/server/logger/rotatingfilelogger.py:1.2 Wed Dec 25 09:15:27 2002
+++ Zope3/src/zope/server/logger/rotatingfilelogger.py Sun Jun 22 10:26:59 2003
@@ -34,8 +34,6 @@
would take time, during which medusa would do nothing else.
"""
- __implements__ = FileLogger.__implements__
-
def __init__(self, file, freq=None, maxsize=None, flush=1, mode='a'):
self.filename = file
self.mode = mode
=== Zope3/src/zope/server/logger/socketlogger.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/server/logger/socketlogger.py:1.2 Wed Dec 25 09:15:27 2002
+++ Zope3/src/zope/server/logger/socketlogger.py Sun Jun 22 10:26:59 2003
@@ -20,11 +20,12 @@
import socket
from zope.server.interfaces.logger import IMessageLogger
+from zope.interface import implements
class SocketLogger(asynchat.async_chat):
"""Log to a stream socket, asynchronously."""
- __implements__ = IMessageLogger
+ implements(IMessageLogger)
def __init__(self, address):
if type(address) == type(''):
=== Zope3/src/zope/server/logger/sysloglogger.py 1.3 => 1.3.10.1 ===
--- Zope3/src/zope/server/logger/sysloglogger.py:1.3 Thu May 1 15:35:48 2003
+++ Zope3/src/zope/server/logger/sysloglogger.py Sun Jun 22 10:26:59 2003
@@ -20,6 +20,7 @@
from zope.server.logger import m_syslog
from zope.server.interfaces.logger import IMessageLogger
+from zope.interface import implements
class SyslogLogger(m_syslog.syslog_client):
@@ -34,7 +35,7 @@
blocking send()
"""
- __implements__ = IMessageLogger
+ implements(IMessageLogger)
svc_name = 'zope'
pid_str = str(os.getpid())
@@ -44,10 +45,8 @@
self.facility = m_syslog.facility_names[facility]
self.address=address
-
def __repr__ (self):
return '<syslog logger address=%s>' % (repr(self.address))
-
def logMessage(self, message):
'See IMessageLogger'
=== Zope3/src/zope/server/logger/taillogger.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/server/logger/taillogger.py:1.2 Wed Dec 25 09:15:27 2002
+++ Zope3/src/zope/server/logger/taillogger.py Sun Jun 22 10:26:59 2003
@@ -17,11 +17,12 @@
"""
from zope.server.interfaces.logger import IMessageLogger
+from zope.interface import implements
class TailLogger:
"""Keep track of the last <size> log messages"""
- __implements__ = IMessageLogger
+ implements(IMessageLogger)
def __init__(self, logger, size=500):
self.size = size
=== Zope3/src/zope/server/logger/unresolvinglogger.py 1.2 => 1.2.26.1 ===
--- Zope3/src/zope/server/logger/unresolvinglogger.py:1.2 Wed Dec 25 09:15:27 2002
+++ Zope3/src/zope/server/logger/unresolvinglogger.py Sun Jun 22 10:26:59 2003
@@ -16,11 +16,12 @@
$Id$
"""
from zope.server.interfaces.logger import IRequestLogger
+from zope.interface import implements
class UnresolvingLogger:
"""Just in case you don't want to resolve"""
- __implements__ = IRequestLogger
+ implements(IRequestLogger)
def __init__(self, logger):
self.logger = logger