Writing irrlicht log to file.

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Writing irrlicht log to file.

Post 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.
Working on game: Marrbles (Currently stopped).
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Writing irrlicht log to file.

Post 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.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Writing irrlicht log to file.

Post 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 :)
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Writing irrlicht log to file.

Post 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. :)
Working on game: Marrbles (Currently stopped).
Post Reply