Commit 4461148e authored by Jim Fulton's avatar Jim Fulton

When Z_DEBUG_MODE is specified and no STUPID_LOG_FILE is specified,

we are supposed to log to standard error. Unfortunately, in this case,
tracebacks were excluded.
parent bdb3fc45
......@@ -46,32 +46,15 @@ def stupid_log_write(subsystem, severity, summary, detail, error):
global _stupid_dest
if _stupid_dest is None:
import os
if os.environ.has_key('STUPID_LOG_FILE'):
f=os.environ['STUPID_LOG_FILE']
if f: _stupid_dest=open(f,'a')
else:
import sys
_stupid_dest=sys.stderr
else: _stupid_dest=sys.stderr
elif os.environ.get('Z_DEBUG_MODE',0):
_stupid_dest=sys.stderr
else:
_stupid_dest=_no_stupid_log
import os
if os.environ.has_key('Z_DEBUG_MODE'):
import sys
sys.stderr.write(
"------\n"
"%s %s %s %s\n%s"
%
(log_time(),
severity_string(severity),
subsystem,
summary,
detail,
)
)
sys.stderr.flush()
if _stupid_dest is _no_stupid_log: return
_stupid_dest.write(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment