Redirect Irrlicht log output

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Ethon
Posts: 21
Joined: Wed Nov 30, 2011 10:01 am

Redirect Irrlicht log output

Post by Ethon »

Hi,
I am using my own logging and Irrlicht logging on its own is very annoying.
I know that I can fetch log events via the IEventReceiver, but how to stop Irrlicht from writing to stdout?

Thanks,
Ethon
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Redirect Irrlicht log output

Post by hendu »

By returning true from your event handler on the log messages ("I handled this message").
Ethon
Posts: 21
Joined: Wed Nov 30, 2011 10:01 am

Re: Redirect Irrlicht log output

Post by Ethon »

Thanks, but at least this
Irrlicht Engine version 1.7.2
Linux 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:44:39 UTC 2012 x86_64
Creating X window...
Visual chosen: : 39
Using renderer: OpenGL 4.1.0
GeForce GTX 550 Ti/PCI/SSE2: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL version: 4.1
can't get redirected to my own log. (I took a look at the source code, its fixed to OutputDebugStringA/printf.)

Snap ...
CuteAlien
Admin
Posts: 9679
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Redirect Irrlicht log output

Post by CuteAlien »

Those messages also seem to use the logger. Maybe you set your event-receiver later on after the device creation? You have to pass it already in createDevice or createDeviceEx to be able to filter those. Look at CLobber.cpp to see that you can catch it before it reaches printf if you have an eventreceiver.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Ethon
Posts: 21
Joined: Wed Nov 30, 2011 10:01 am

Re: Redirect Irrlicht log output

Post by Ethon »

Code: Select all

// Only catch log events.
if(event.EventType == irr::EET_LOG_TEXT_EVENT)
    return false;
Head -> Desk. No wonder all log events went through. :oops:

But thanks. :D
Post Reply