Suppress default ppython messages

Hey all,

You all probably know that a typical ppython run looks like this:

DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
:util(warning): Adjusting global clock's real time by x.xxxxx seconds.
:util(warning): Adjusting global clock's real time by -x.xxxxx seconds.

Well, I found some ways to suppress part of the unneccessary messages.

First of all, what is that DirectStart:starting the game. doing there?
Well, there are two ways to solve that.

  1. (recommended) By not calling this:
import direct.directbase.DirectStart

so leave that line away, and instead use:

from direct.showbase import ShowBase
ShowBase.ShowBase()

This works excactly the same, except for the message then.
2. You could easily change it in the source of Panda3D, because ShowBase is a python module. To do that, comment out (or remove) the first line in PandaRoot/direct/src/directbase/DirectStart.py

Now, the “interval” thing. The only way to solve that by commenting out lines 54-56 in PandaRoot/direct/src/directnotify/DirectNotify.py.
So, the code should now look like:

        #else:
        #    print "Warning: DirectNotify: category '%s' already exists" % \
        #          (categoryName)

I’m still figuring how to suppress the other ones. I will soon post an update.

In my Config.prc there is this line:

notify-level warning

There is also some info there. I think that changing the line to:

notify-level fatal

will suppress most messages.

The console output can be tailored to whatever your needs are, by setting a notification level for particular channels, either in the config file or directly in the code like this:

from pandac.PandaModules import loadPrcFileData
loadPrcFileData( '', 'notify-level-util error' )
...

Level “error” should be enough to get rid of most warnings. To see what channels Panda3D offset you can use the following line (about thirty, without counting them):

cvMgr.listVariables()

Hope this helps,
enn0x

Thank you enn0x and Laurens,

I’ll try that.

Whatever I do, these two keeps popping up:

Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)

Is there an easy way to suppress these, except changing the source code?

Have a look at these files:

“DirectStart: Starting the game.”
–> panda3d-1.3.2\direct\src\directbase\DirectStart.py, line 1

“Warning: DirectNotify: category ‘Interval’ already exists”
–> panda3d-1.3.2\direct\src\directnotify\DirectNotify.py, line 55

You don’t need to re-compile Panda3D after editing Python-files, so this is not exactly what you have been asking for, but it is a way to get rid of these messages.

“Known pipe types:…”
This is C++ again. I don’t know a solution, only a workaround: send the notify output to a file using the config option “notify-output foo.txt”.

enn0x

This can be done wayyy easier. (check my first post)

Already noticed them :slight_smile: I just wanted to know if there’s a way to prevent them without changing the Panda3D source.

Good idea! I’ll try that.
Will it also work to send them to /dev/null ?

Is there any way I can suppress the error resulting form not having dx9? I can’t install it due to admins but my game runs fine without it. The window that pops up is annoying.

Sorry to wake up this ancient thread.
I still found the DirectNotify error rather annoying. People easily get confused by it and think there is something wrong while it’s actually quite innocent.
Problem with this error is that the Interval category gets added multiple times. Once in direct/src/interval/Interval (correct), but also in extensions/CInterval-extensions.py and extensions_native/CInterval_extensions.py.
It should be possible to eliminate the error by changing these few lines in both locations:

notify = directNotify.addCategory("Interval")

to:

if directNotify.hasCategory("Interval"):
  notify = directNotify.getCategory("Interval")
else:
  notify = directNotify.addCategory("Interval")

Alternatively, we can just remove the warning.

Can I check these changes in, David?

I think we should just remove the warning. It’s not really helping anyone.

David

Done. Thanks! No longer will this warning annoy or confuse anyone. :slight_smile: