Redirecting MyGUI log to Ogre log
I would like to stop MyGUI from logging into its own file and instead dump these messages into the Ogre log (which we're basically using as a general log, instead of several separated ones).
Would it work if I derive from the LogManager, redirect the messages in here and create this log manager before creating the Gui system or would this produce internal problems?
Well, the only possible way now is rewrite LogManager and LogStream.
inline LogStream& operator<<(T _value) might be enough.
I ran into this issue as well, except that I would like to redirect the messages to a console of sorts. I would like to request the feature of being able to derive a custom version of LogStream and register that using a function in LogManager.
When you're doing this, be careful to consider any threads running... if two threads are logging to the same file simultaneously it could mess up your log messages.... I don't know how ogre does assures threadsafe loggin, but it might be worth to find out, check for mutexes etc. It all depends on how you set up your render loop I guess.
On the other hand it might not be worth the effort. You could just dump it all in the log and fix it only if it's broken. But I thought it would be nice to know why your blog has messages written through each other, should it happen...
We already implemented possibility for redirecting logs easily and for adding logs listeners, but it wasn't released yet. If you need it you can try svn version.
I'm looking at MyGUI_LogManager.h in SVN. How am I supposed to get the default LogSource so I can add my own listeners to it? It's private.