Redirecting MyGUI log to Ogre log

Alekiel

24-04-2010 07:19:36

Hello.

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?

Altren

25-04-2010 23:20:58

Well, the only possible way now is rewrite LogManager and LogStream.
Rewriting inline LogStream& operator<<(T _value) might be enough.

tp

27-08-2010 06:39:45

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.

guido

27-08-2010 10:25:18

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...

Altren

27-08-2010 14:39:10

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.

scrawl

25-02-2014 19:38:43

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.