Direct Notify Output

The problem is that DirectNotify (and the lower-level C++ notify system) read the output filename at the very startup of the application, that is when you import panda3d.core, so by the time you have run loadPrcFileData() it is too late to change it.

One solution would be to put the notify-output command in an external prc file, which is always read at application start. This doesn’t help if you want to generate a dynamic filename as you are doing here, though.

So, another solution is to use the low-level calls to specifically redirect the notify systems to your log file, instead of going through the prc system, like this:

fs = pofstream()
Filename.textFilename('file.log').openAppend(fs)
Notify.ptr().setOstreamPtr(fs, False)
base.notify.__class__.streamWriter = StreamWriter(Notify.out(), False)

David