[Zodb-checkins] CVS: Zope/lib/python/zLOG -
MinimalLogger.py:1.13.6.1
Jeremy Hylton
jeremy at zope.com
Fri Jun 13 12:48:26 EDT 2003
Update of /cvs-repository/Zope/lib/python/zLOG
In directory cvs.zope.org:/tmp/cvs-serv10166/lib/python/zLOG
Modified Files:
Tag: Zope-2_6-branch
MinimalLogger.py
Log Message:
Cross-port bug fixes from the ZODB3-3_1-branch.
=== Zope/lib/python/zLOG/MinimalLogger.py 1.13 => 1.13.6.1 ===
--- Zope/lib/python/zLOG/MinimalLogger.py:1.13 Fri Aug 16 16:28:45 2002
+++ Zope/lib/python/zLOG/MinimalLogger.py Fri Jun 13 11:47:55 2003
@@ -75,24 +75,26 @@
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))
+ buf.append(line)
if 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
+ buf.append(str(detail))
if error:
try:
lines = format_exception(error[0], error[1], error[2],
limit=100)
- print >> _log_dest, ''.join(lines)
+ buf.append(''.join(lines))
except:
- print >> _log_dest, "%s: %s" % error[:2]
+ buf.append("%s: %s" % error[:2])
+
+ if buf[-1] and buf[-1][-1] != "\n":
+ buf.append("") # Cause a final \n to be appended
+
+ _log_dest.write("\n".join(buf))
_log_dest.flush()
More information about the Zodb-checkins
mailing list