Disabling log output?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Tels
Posts: 65
Joined: Fri Feb 27, 2004 7:56 pm
Location: Antarctica
Contact:

Disabling log output?

Post by Tels »

Moin,

here is a test output from Perl:

te@null:~/perl/Irrlicht/Games-Irrlicht-0.03> perl t/szenemanager.t
1..4
ok 1 - use Games::Irrlicht;
ok 2 - Games::Irrlicht->can('FileSystem')
Irrlicht Engine version 0.5
Linux
Creating X window...
debugtest Choosing visual display with stencil...
Starting windowed mode...
Connecting glx context to window...
Window created.
OpenGL Renderer.
OpenGL driver version is 1.2 or better.
Multitexturing disabled.
Loaded texture: #DefaultFont
ok 3
ok 4 - Could add FPS camera
Deleting window...

Now, the testsuite really shouldn't output anything except "ok 4" or "not ok 4" lines, except maybe "# some comment" lines.

However, I have not found a way to disable the logging from Irrlicht. Is this actually possible? Or to redirect it into a file?

Cheers,

Tels
Perl + Irrlicht + Audiere = Game: http://bloodgate.com/perl/game
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

You can create an event receiver, and when you get a log event, just return 'true'. Another way would be to set the log level of the Logger, in device->getLogger().
Tels
Posts: 65
Joined: Fri Feb 27, 2004 7:56 pm
Location: Antarctica
Contact:

Post by Tels »

"You can create an event receiver, and when you get a log event, just return 'true'. Another way would be to set the log level of the Logger, in device->getLogger()."

Thank you, exactly what I am looking for. I created my own event receiver anyway so I can disable events for the testsuite (had it printf "event received" and wondered why so many events passed along, but never looked _what_ events that where :)

Best wishes,

Tels
Perl + Irrlicht + Audiere = Game: http://bloodgate.com/perl/game
Tels
Posts: 65
Joined: Fri Feb 27, 2004 7:56 pm
Location: Antarctica
Contact:

Post by Tels »

another way would be to set the log level of the Logger, in device->getLogger().
This does not work, because (I think) you can only set the loglevel _after_ you have created the device:

Code: Select all

  device =
     createDevice(
        EDT_OPENGL,                     // renderer
        dimension2d<s32>(w, h),         // size
        d,                              // bit depth
        fs,                             // fullscreen?
        false,                          // stencilbuffer
        &receiver);                     // event receiver
  if (NULL == device) { return 0; }     // error

  logger = device->getLogger();
  logger->setLogLevel(ELL_ERROR);
At this point it is too late, you already got messages printed out by createDevice. :-/

However, eating them in the custom event receiver works great :)

Cheers,

Tels
Perl + Irrlicht + Audiere = Game: http://bloodgate.com/perl/game
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Yep, ok, that's right. You would still get the texts which are printed during the creation of the device.
Tels
Posts: 65
Joined: Fri Feb 27, 2004 7:56 pm
Location: Antarctica
Contact:

Post by Tels »

niko wrote:Yep, ok, that's right. You would still get the texts which are printed during the creation of the device.
Do you have plans to change this? The "disable log output" isn't very usefull right now :o)

Cheers,

Tels
Perl + Irrlicht + Audiere = Game: http://bloodgate.com/perl/game
Post Reply