I used this and it works fine if i run my client as py file:
import logging
#create an ampty log file
fname='error.log'
file=open(fname,"w")
file.close()
logging.basicConfig(filename=fname,filemode='w')
try:
#client is like main.py
import client
except Exception, ex:
logging.exception("")
But it does not work as a p3d file, the error.log file does not get the error written.
This:
nout = MultiplexStream()
Notify.ptr().setOstreamPtr(nout, 0)
nout.addFile(Filename("out.txt"))
shows only panda errors, but not a division by 0.
And sadly the panda runtime log folder log files dont show any errors at all.
How could i see/create a log file with error messages like this:
Traceback (most recent call last):
File "client.py", line 10786, in <module>
run()
File "D:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 2531, in run
self.taskMgr.run()
File "D:\Panda3D-1.7.0\direct\task\Task.py", line 496, in run
self.step()
File "D:\Panda3D-1.7.0\direct\task\Task.py", line 454, in step
self.mgr.poll()
File "D:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 61, in eventLoopTask
self.doEvents()
File "D:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 55, in doEvents
processFunc(self.eventQueue.dequeueEvent())
File "D:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 122, in processEvent
messenger.send(eventName, paramList)
File "D:\Panda3D-1.7.0\direct\showbase\Messenger.py", line 325, in send
self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
File "D:\Panda3D-1.7.0\direct\showbase\Messenger.py", line 410, in __dispatch
method (*(extraArgs + sentArgs))
File "client.py", line 2040, in buttons
self.clogic(but,tag)
File "client.py", line 5089, in clogic
x=10/0
ZeroDivisionError: integer division or modulo by zero
Thank you in advance.