[Zope-Checkins] CVS: Zope3/lib/python/Zope/ZLogger - .testinfo:1.2 FileLogger.py:1.2 ZLogger.py:1.3 __init__.py:1.3 stupidFileLogger.py:1.11 syslog.py:1.5 syslogLogger.py:1.10 test_logger.py:1.3
Jim Fulton
jim@zope.com
Mon, 10 Jun 2002 19:30:17 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/ZLogger
In directory cvs.zope.org:/tmp/cvs-serv20468/lib/python/Zope/ZLogger
Modified Files:
FileLogger.py ZLogger.py __init__.py stupidFileLogger.py
syslog.py syslogLogger.py test_logger.py
Added Files:
.testinfo
Log Message:
Merged Zope-3x-branch into newly forked Zope3 CVS Tree.
=== Zope3/lib/python/Zope/ZLogger/.testinfo 1.1 => 1.2 ===
=== Zope3/lib/python/Zope/ZLogger/FileLogger.py 1.1 => 1.2 ===
+#
+# 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.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
class FileLogger:
""" a File Logger
@@ -9,5 +27,10 @@
pass
def __call__(self, sub, sev, sum, det, err):
- print 'syslogger %s, %s, %s, %s, %s, %s' % (self, sub, sev, sum, det, err)
+ print 'syslogger %s, %s, %s, %s, %s, %s' % (self,
+ sub,
+ sev,
+ sum,
+ det,
+ err)
=== Zope3/lib/python/Zope/ZLogger/ZLogger.py 1.2 => 1.3 ===
+#
+# 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.
+#
+##############################################################################
import stupidFileLogger
import syslogLogger
=== Zope3/lib/python/Zope/ZLogger/__init__.py 1.2 => 1.3 ===
#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# 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
+# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-
import ZLogger
=== Zope3/lib/python/Zope/ZLogger/stupidFileLogger.py 1.10 => 1.11 ===
#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# 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
+# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import time, sys, os, thread
+import time, sys, os, thread
from zLOG import severity_string, log_time, format_exception
@@ -92,9 +93,9 @@
if error:
try:
- _stupid_dest.write(''.join(format_exception(
+ _stupid_dest.write(format_exception(
error[0], error[1], error[2],
- limit=100)))
+ trailer='\n', limit=100))
except:
_stupid_dest.write("%s: %s\n" % error[:2])
_stupid_dest.flush()
=== Zope3/lib/python/Zope/ZLogger/syslog.py 1.4 => 1.5 ===
+#
+# 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.
+#
+##############################################################################
# -*- Mode: Python; tab-width: 4 -*-
# From: "Samual M. Rushing" <rushing@nightmare.com>
@@ -138,11 +151,12 @@
}
import socket
+from types import StringType
class syslog_client:
def __init__ (self, address='/dev/log'):
self.address = address
- if type (address) == type(''):
+ if isinstance(address, StringType):
try: # APUE 13.4.2 specifes /dev/log as datagram socket
self.socket = socket.socket( socket.AF_UNIX
, socket.SOCK_DGRAM)
@@ -175,9 +189,9 @@
self.socket.sendto (message, self.address)
def encode_priority (self, facility, priority):
- if type(facility) == type(''):
+ if instance(facility, StringType):
facility = facility_names[facility]
- if type(priority) == type(''):
+ if isinstance(priority, StringType):
priority = priority_names[priority]
return (facility<<3) | priority
=== Zope3/lib/python/Zope/ZLogger/syslogLogger.py 1.9 => 1.10 ===
#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# 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
+# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from syslog import syslog_client, LOG_ALERT, LOG_ERR, LOG_WARNING, LOG_NOTICE
=== Zope3/lib/python/Zope/ZLogger/test_logger.py 1.2 => 1.3 ===
+#
+# 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.
+#
+##############################################################################
import sys
import socket
import select