EDoc::Logger Class Reference

#include <include/EDoc/Logger.h>


Detailed Description

Simple logging singleton class.

Definition at line 44 of file Logger.h.

Public Member Functions

 ~Logger ()
 Destructor.
void ClearUseFile ()
 Ensure it does not log to any files.
bool GetUseFile () const
 If true log to a file.
bool GetLogFileName (std::string &filename_out) const
 If logging to a file returns true and also returns the name of the file being logged to.
bool SetLogFilename (std::string filename_in)
 Set the name of the file to log to.
bool SetLogFilenameFullyQualified (std::string filename_in)
 Set the name of the file to log to including the full path.
void LogMessage (const std::string &message)
 Logs a message to all appropiate output sources.

Static Public Member Functions

static LoggerInstance ()
 Singleton accessor.
static void Destroy ()
 Deletes singleton.

Data Fields

bool use_stdout
 If true log to stdout.
bool use_stderr
 If true log to stderr.

Private Member Functions

 Logger ()
 Constructor.
void InitialiseFile ()
 Called to setup the file to be logged to.

Private Attributes

bool use_file
 If true log to file.
std::string filename
 Name of file being loged to.
std::ofstream file
 Output stream for file to log to.
bool file_initialised
 True if the file to log to has been initialized false if needs to be opened before logging.

Static Private Attributes

static Loggerinstance
 Singleton instance for logger.


Constructor & Destructor Documentation

EDoc::Logger::~Logger (  ) 

Destructor.

Note:
EDoc++ data included.

Definition at line 88 of file Logger.cpp.

References file, and use_file.

EDoc::Logger::Logger (  )  [private]

Constructor.

Note:
EDoc++ data included.

Definition at line 47 of file Logger.cpp.

References filename, EDoc::MakeTemporaryFile(), SetLogFilenameFullyQualified(), use_file, use_stderr, and use_stdout.

Referenced by Instance().


Member Function Documentation

EDoc::Logger::Instance (  )  [inline, static]

Singleton accessor.

Note:
EDoc++ data included.

Definition at line 51 of file Logger.h.

References instance, and Logger().

EDoc::Logger::Destroy (  )  [inline, static]

Deletes singleton.

Note:
EDoc++ data included.

Definition at line 64 of file Logger.h.

References instance.

EDoc::Logger::ClearUseFile (  ) 

Ensure it does not log to any files.

EDoc::Logger::GetUseFile (  )  const

If true log to a file.

EDoc::Logger::GetLogFileName ( std::string &  filename_out  )  const

If logging to a file returns true and also returns the name of the file being logged to.

EDoc::Logger::SetLogFilename ( std::string  filename_in  ) 

Set the name of the file to log to.

EDoc::Logger::SetLogFilenameFullyQualified ( std::string  filename_in  ) 

Set the name of the file to log to including the full path.

Note:
EDoc++ data included.

Definition at line 96 of file Logger.cpp.

References file, file_initialised, filename, and use_file.

Referenced by Logger().

EDoc::Logger::LogMessage ( const std::string &  message  )  [inline]

Logs a message to all appropiate output sources.

Note:
EDoc++ data included.

Definition at line 117 of file Logger.h.

References file, file_initialised, InitialiseFile(), use_file, use_stderr, and use_stdout.

EDoc::Logger::InitialiseFile (  )  [private]

Called to setup the file to be logged to.

Note:
EDoc++ data included.

Definition at line 110 of file Logger.cpp.

References EDOC_THROW_EXCEPTION, file, file_initialised, and filename.

Referenced by LogMessage().


Field Documentation

bool EDoc::Logger::use_stdout

If true log to stdout.

Definition at line 81 of file Logger.h.

Referenced by Logger(), and LogMessage().

bool EDoc::Logger::use_stderr

If true log to stderr.

Definition at line 86 of file Logger.h.

Referenced by Logger(), and LogMessage().

bool EDoc::Logger::use_file [private]

If true log to file.

Definition at line 159 of file Logger.h.

Referenced by Logger(), LogMessage(), SetLogFilenameFullyQualified(), and ~Logger().

std::string EDoc::Logger::filename [private]

Name of file being loged to.

Definition at line 164 of file Logger.h.

Referenced by InitialiseFile(), Logger(), and SetLogFilenameFullyQualified().

std::ofstream EDoc::Logger::file [private]

Output stream for file to log to.

Definition at line 169 of file Logger.h.

Referenced by InitialiseFile(), LogMessage(), SetLogFilenameFullyQualified(), and ~Logger().

bool EDoc::Logger::file_initialised [private]

True if the file to log to has been initialized false if needs to be opened before logging.

Definition at line 175 of file Logger.h.

Referenced by InitialiseFile(), LogMessage(), and SetLogFilenameFullyQualified().

Logger * EDoc::Logger::instance [static, private]

Singleton instance for logger.

Definition at line 180 of file Logger.h.

Referenced by Destroy(), and Instance().


The documentation for this class was generated from the following files:
Generated on Tue Jan 20 18:26:09 2009 for EDoc-0.2.1 by  doxygen 1.5.1