I was just looking at some logs and some of the errors logged without
tracebacks, I work out it was when I wasn't passing the error object to
log.err- Is this by design?
Here is some code which shows it logging and not logging the traceback
import os
from twisted.python import log
from twisted.python.logfile import DailyLogFile
logfile=
DailyLogFile.fromFullPath(os.path.join(os.path.dirname(__file__),"error.log"))
log.startLogging(logfile)
def zero_error():
1/0
def stack(x):
if not x:
zero_error()
else:
stack(x-1)
def work(x,pass_exception):
try:
stack(x)
except Exception as e:
log.err(e if pass_exception else None)
if __name__ == "__main__":
work(5,True) #Doesn't log traceback
work(5,False) #Does log
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python