Panda3D Manual: Log Messages
<<prev | top | next>> |
Panda periodically outputs log messages for debugging purposes. A typical log message might look like this:
:util(warning): Adjusting global clock's real time by -3.3 seconds.
The first part of the message, `util`, is the name of the module that generated the message. The second part, `warning`, indicates the severity. The severity levels are, in decreasing order: fatal, error, warning, info, debug, and spam. The panda configuration file (Config.prc) contains these directives:
notify-level warning default-directnotify-level warning
Directives like these tell panda which messages to show, and which to suppress. In the default configuration (shown above), all messages whose severity is `warning` or above are shown, all messages whose severity is less are suppressed. It is interesting and educational to change the configuration to this:
notify-level spam default-directnotify-level spam
If you do this, panda will print out vast amounts of information while it runs. These informational messages can be useful for debugging. However, there are so many print-statements that it slows panda down to a crawl. So it may be desirable to tell panda to narrow it down a little. The way to do that is to name a particular module in the panda config file. For example, you might do this:
notify-level warning notify-level-glgsg spam default-directnotify-level warning
This tells panda that module "glgsg" should print out everything it can, but that every other module should only print warnings and errors. By the way, module `glgsg` is a particularly interesting module to investigate. This is the module that invokes OpenGL. If you tell it to spam you, it will tell you what it's setting the MODELVIEW and PROJECTION matrices to, and lots of other interesting information. ## Generating your own Log Messages You can use the `Notify` class to output your own log messages. FINISH THIS SECTION. ## Redirecting Log Messages to a File If you wish, you can redirect all of panda's log messages into a file. The following snippet will do the trick:
nout = MultiplexStream() Notify.ptr().setOstreamPtr(nout, 0) nout.addFile(Filename("out.txt"))
<<prev | top | next>> |