Logger Class Reference

#include <log.h>

List of all members.


Detailed Description

The Log Class : Useful to write debug or info messages.

Definition at line 32 of file log.h.


Public Member Functions

 Logger ()
 Constructor.
 ~Logger ()
 Destructor, closes log file.
void setLogFile (const std::string &logFilename)
 Sets the file to log to and opens it.
void setLogToStandardOut (bool value)
 Sets whether the log should be written to standard output.
void setChatWindow (ChatWindow *window)
 Enables logging to chat window.
void log (const char *log_text,...)
 Enters a message in the log.
void error (const std::string &error_text)
 Log an error and quit.

Private Attributes

std::ofstream mLogFile
bool mLogToStandardOut
ChatWindowmChatWindow

Constructor & Destructor Documentation

Logger::Logger (  ) 

Constructor.

Definition at line 37 of file log.cpp.

Logger::~Logger (  ) 

Destructor, closes log file.

Definition at line 43 of file log.cpp.


Member Function Documentation

void Logger::setLogFile ( const std::string &  logFilename  ) 

Sets the file to log to and opens it.

Definition at line 51 of file log.cpp.

void Logger::setLogToStandardOut ( bool  value  )  [inline]

Sets whether the log should be written to standard output.

Definition at line 53 of file log.h.

void Logger::setChatWindow ( ChatWindow window  )  [inline]

Enables logging to chat window.

Definition at line 58 of file log.h.

void Logger::log ( const char *  log_text,
  ... 
)

Enters a message in the log.

The message will be timestamped.

Definition at line 62 of file log.cpp.

void Logger::error ( const std::string &  error_text  ) 

Log an error and quit.

The error will pop-up on Windows and Mac, and will be printed to standard error everywhere else.

Definition at line 113 of file log.cpp.


Member Data Documentation

std::ofstream Logger::mLogFile [private]

Definition at line 76 of file log.h.

bool Logger::mLogToStandardOut [private]

Definition at line 77 of file log.h.

Definition at line 78 of file log.h.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5