I was looking at the DefaultLogger class. I notice it has an option to cache messages to a container.
I don't see any code to flush the cache to the output stream except when the file name is changed.
Is this the intended behavior? Shouldn't there be a method to flush it and flush on destruction?
Thanks
logger caching?
Moderators: CEGUI MVP, CEGUI Team
logger caching?
-- Doctor Doctor, it hurts when I ....
Re: logger caching?
Hi jays, I presume the intention of caching messages was written specifically to provide a means for core CEGUI sub-systems to add messages to the log prior to the creation of the log-file. For example, the DefaultLogger's constructor logs some events prior to the log-file being opened; since the log-file (by default) is not opened until CEGUI::System's constructor is called.
Once the log-file has been opened, there is no longer a need for the caching mechanism at all. The reasoning behind this is that, if there is a fatal error that causes the application to quit unexpectedly the data within the cache would never be written to the log file, even if this where provided in the destructor; because in this case, the destructor would never be called. Thus, there was never a reason to extend the caching interface to the client.
I cannot see any benefit in adding this to the API. Caching events only serves to reduce the effectiveness of the log-file. Also, users are free to create their own derivations of the logger to suite their own needs. I believe that v0.7.0 also now provides a null-logger, which does nothing and thus produces no log-file at all. So if you really want to use caching, you only need to create a custom logger to do so.
Once the log-file has been opened, there is no longer a need for the caching mechanism at all. The reasoning behind this is that, if there is a fatal error that causes the application to quit unexpectedly the data within the cache would never be written to the log file, even if this where provided in the destructor; because in this case, the destructor would never be called. Thus, there was never a reason to extend the caching interface to the client.
I cannot see any benefit in adding this to the API. Caching events only serves to reduce the effectiveness of the log-file. Also, users are free to create their own derivations of the logger to suite their own needs. I believe that v0.7.0 also now provides a null-logger, which does nothing and thus produces no log-file at all. So if you really want to use caching, you only need to create a custom logger to do so.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 8 guests