#include <include/EDoc/Logger.h>
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 Logger * | Instance () |
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 Logger * | instance |
Singleton instance for logger. |
EDoc::Logger::~Logger | ( | ) |
EDoc::Logger::Logger | ( | ) | [private] |
Constructor.
Definition at line 47 of file Logger.cpp.
References filename, EDoc::MakeTemporaryFile(), SetLogFilenameFullyQualified(), use_file, use_stderr, and use_stdout.
Referenced by Instance().
EDoc::Logger::Instance | ( | ) | [inline, static] |
EDoc::Logger::Destroy | ( | ) | [inline, static] |
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.
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.
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.
Definition at line 110 of file Logger.cpp.
References EDOC_THROW_EXCEPTION, file, file_initialised, and filename.
Referenced by LogMessage().
If true log to stdout.
Definition at line 81 of file Logger.h.
Referenced by Logger(), and LogMessage().
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().