How to disable logging?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

SalvoFa
Not too shy to talk
Not too shy to talk
Posts: 29
Joined: Mon Feb 25, 2008 15:25
Location: Italy

How to disable logging?

Postby SalvoFa » Thu Jul 24, 2008 14:08

Hi all!

How can I disable the CEGUI.log file creation?
I've a read-only filesystem and I can't let my application to write data in the filesystem!

Thank you.

Salvo

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Jul 25, 2008 08:43

Hi,

Probably the simplest way is to create a custom logger subclass of CEGUI::Logger that does nothing (or whatever else you like). In order that your new logger get used instead of the default one, you must manually instantiate the new logger singleton prior to creating the CEGUI::System object.

HTH

CE.

Toge
Just popping in
Just popping in
Posts: 12
Joined: Thu Jan 22, 2009 21:59

Re: How to disable logging?

Postby Toge » Mon Jun 15, 2009 09:56

Include this code in your source before use CEGUI first time to disable CEGUI.log.

Code: Select all

class NoLogger : public CEGUI::Logger
{
                   void logEvent (const CEGUI::String&, CEGUI::LoggingLevel)
                   {

                   }
                   void setLogFilename(const CEGUI::String&, bool)
                   {      

                   }
};

NoLogger nL;


Return to “Help”

Who is online

Users browsing this forum: No registered users and 10 guests