Crazy Eddie's GUI System  0.8.6
CEGUI::DefaultLogger Class Reference

Default implementation for the Logger class. If you want to redirect CEGUI logs to some place other than a text file, implement your own Logger implementation and create a object of the Logger type before creating the CEGUI::System singleton. More...

+ Inheritance diagram for CEGUI::DefaultLogger:
+ Collaboration diagram for CEGUI::DefaultLogger:

Public Member Functions

void logEvent (const String &message, LoggingLevel level=Standard)
 Add an event to the log. More...
 
void setLogFilename (const String &filename, bool append=false)
 Set the name of the log file where all subsequent log entries should be written. The interpretation of file name may differ depending on the concrete logger implementation. More...
 
- Public Member Functions inherited from CEGUI::Logger
 Logger (void)
 Constructor for Logger object.
 
virtual ~Logger (void)
 Destructor for Logger object.
 
void setLoggingLevel (LoggingLevel level)
 Set the level of logging information that will get out to the log file. More...
 
LoggingLevel getLoggingLevel (void) const
 return the current logging level setting More...
 

Protected Types

typedef std::pair< String, LoggingLevelCacheItem
 
typedef std::vector< CacheItem CEGUI_VECTOR_ALLOC(CacheItem)> Cache
 

Protected Attributes

std::ofstream d_ostream
 Stream used to implement the logger.
 
std::ostringstream d_workstream
 Used to build log entry strings.
 
Cache d_cache
 Used to cache log entries before log file is created.
 
bool d_caching
 true while log entries are beign cached (prior to logfile creation)
 
- Protected Attributes inherited from CEGUI::Logger
LoggingLevel d_level
 Holds current logging level.
 

Additional Inherited Members

- Static Public Member Functions inherited from CEGUI::Singleton< Logger >
static LoggergetSingleton (void)
 
static LoggergetSingletonPtr (void)
 
- Static Protected Attributes inherited from CEGUI::Singleton< Logger >
static Loggerms_Singleton
 

Detailed Description

Default implementation for the Logger class. If you want to redirect CEGUI logs to some place other than a text file, implement your own Logger implementation and create a object of the Logger type before creating the CEGUI::System singleton.

Member Function Documentation

void CEGUI::DefaultLogger::logEvent ( const String message,
LoggingLevel  level = Standard 
)
virtual

Add an event to the log.

Parameters
messageString object containing the message to be added to the event log.
levelLoggingLevel for this message. If level is greater than the current set logging level, the message is not logged.
Returns
Nothing

Implements CEGUI::Logger.

void CEGUI::DefaultLogger::setLogFilename ( const String filename,
bool  append = false 
)
virtual

Set the name of the log file where all subsequent log entries should be written. The interpretation of file name may differ depending on the concrete logger implementation.

Note
When this is called, and the log file is created, any cached log entries are flushed to the log file.
Parameters
filenameName of the file to put log messages.
append
  • true if events should be added to the end of the current file.
  • false if the current contents of the file should be discarded.

Implements CEGUI::Logger.