Page 1 of 1

Writing irrlicht log to file.

Posted: Sun Oct 14, 2012 9:34 pm
by serengeor
I talked with someone on irc channel about writing irrlicht log to file and as far as I've looked it seams that there's no way of doing that right now? (except by modifying engine yourself ofc.)

If not:
I'm thinking maybe ILogger interface should let user intercept log messages via callback class. Which would basically allow to do what ever you want with them.

Re: Writing irrlicht log to file.

Posted: Mon Oct 15, 2012 7:17 am
by hendu
FWIW, what I do is redirect stdout and stderr to files (on windows). Of course won't work if you need both logging and console output.

Re: Writing irrlicht log to file.

Posted: Mon Oct 15, 2012 9:14 am
by greenya
The only way to write log to the file without modifying Irrlicht source (and i guess that is the way how it was supposed to be done by the developers or Irrlicht) is to handle log events in your event receiver (they has EET_LOG_TEXT_EVENT event type). You can do there what ever you need. Just remember: while you handle it do not do any logging, otherwise that will stack overflow because of recursive handling the event :)

Re: Writing irrlicht log to file.

Posted: Mon Oct 15, 2012 9:34 am
by serengeor
greenya wrote:The only way to write log to the file without modifying Irrlicht source (and i guess that is the way how it was supposed to be done by the developers or Irrlicht) is to handle log events in your event receiver (they has EET_LOG_TEXT_EVENT event type). You can do there what ever you need. Just remember: while you handle it do not do any logging, otherwise that will stack overflow because of recursive handling the event :)
Oh, I totally forgot there was such event. That makes sense then, probably should be mentioned somewhere in ILogger interface doc. :)