[Zodb-checkins] CVS: Zope/lib/python/zLOG - MinimalLogger.py:1.13.4.2
Chris McDonough
chrism@zope.com
Tue, 8 Oct 2002 14:41:17 -0400
Update of /cvs-repository/Zope/lib/python/zLOG
In directory cvs.zope.org:/tmp/cvs-serv20268/lib/python/zLOG
Modified Files:
Tag: chrism-install-branch
MinimalLogger.py
Log Message:
Merging HEAD into chrism-install-branch.
=== Zope/lib/python/zLOG/MinimalLogger.py 1.13.4.1 => 1.13.4.2 ===
--- Zope/lib/python/zLOG/MinimalLogger.py:1.13.4.1 Mon Sep 16 02:00:55 2002
+++ Zope/lib/python/zLOG/MinimalLogger.py Tue Oct 8 14:41:16 2002
@@ -15,11 +15,6 @@
import os, sys, time
-try:
- import textwrap
-except ImportError:
- textwrap = None
-
from FormatException import format_exception
def severity_string(severity, mapping={
@@ -80,28 +75,24 @@
def log(self, subsystem, severity, summary, detail, error):
if _log_dest is None or severity < _log_level:
return
- buf = ["------"]
- line = ("%s %s %s %s" %
- (log_time(), severity_string(severity), subsystem, summary))
- if not textwrap or len(line) < 80:
- buf.append(line)
- else:
- buf.extend(textwrap.wrap(line, subsequent_indent=" "*20))
if detail:
- buf.append(str(detail))
+ buf = ("------\n"
+ "%s %s %s %s\n%s" % (log_time(), severity_string(severity),
+ subsystem, summary, detail))
+ else:
+ buf = ("------\n"
+ "%s %s %s %s" % (log_time(), severity_string(severity),
+ subsystem, summary))
+ print >> _log_dest, buf
if error:
try:
lines = format_exception(error[0], error[1], error[2],
limit=100)
- buf.append(''.join(lines))
- except '':
- buf.append("%s: %s" % error[:2])
-
- buf.append("") # Cause a final \n to be appended
-
- _log_dest.write("\n".join(buf))
+ print >> _log_dest, ''.join(lines)
+ except:
+ print >> _log_dest, "%s: %s" % error[:2]
_log_dest.flush()