Log writing utilities. More...
#include <LogManager.h>
Public Types | |
typedef SignalTraits< void(const std::string &)> | SignalLog |
Public Member Functions | |
bool | getEnabled () const |
const std::string & | getLogFile () const |
ADCHPP_DLL void | log (const std::string &area, const std::string &msg) throw () |
Add a line to the log. | |
void | setEnabled (bool enabled_) |
void | setLogFile (const std::string &fileName) |
SignalLog::Signal & | signalLog () |
Static Public Member Functions | |
static void | deleteInstance () |
static LogManager * | getInstance () |
static void | newInstance () |
Private Member Functions | |
ADCHPP_DLL void | dolog (const std::string &msg) throw () |
LogManager () | |
virtual | ~LogManager () throw () |
Private Attributes | |
bool | enabled |
std::string | logFile |
FastMutex | mtx |
SignalLog::Signal | signalLog_ |
Static Private Attributes | |
static ADCHPP_DLL LogManager * | instance = 0 |
Friends | |
class | Singleton< LogManager > |
Log writing utilities.
Definition at line 30 of file LogManager.h.
typedef SignalTraits<void (const std::string&)> adchpp::LogManager::SignalLog |
Definition at line 46 of file LogManager.h.
adchpp::LogManager::LogManager | ( | ) | [private] |
Definition at line 31 of file LogManager.cpp.
virtual adchpp::LogManager::~LogManager | ( | ) | throw () [inline, private, virtual] |
Definition at line 57 of file LogManager.h.
static void adchpp::Singleton< LogManager >::deleteInstance | ( | ) | [inline, static, inherited] |
Definition at line 49 of file Singleton.h.
void adchpp::LogManager::dolog | ( | const std::string & | msg | ) | throw () [private] |
Definition at line 44 of file LogManager.cpp.
References adchpp::File::CREATE, dcdebug, adchpp::File::ensureDirectory(), adchpp::Util::formatTime(), adchpp::Util::getCfgPath(), adchpp::File::makeAbsolutePath(), adchpp::File::OPEN, adchpp::File::setEndPos(), adchpp::File::write(), and adchpp::File::WRITE.
bool adchpp::LogManager::getEnabled | ( | ) | const [inline] |
Definition at line 44 of file LogManager.h.
References enabled.
static LogManager * adchpp::Singleton< LogManager >::getInstance | ( | ) | [inline, static, inherited] |
Definition at line 37 of file Singleton.h.
const std::string& adchpp::LogManager::getLogFile | ( | ) | const [inline] |
Definition at line 41 of file LogManager.h.
References logFile.
void adchpp::LogManager::log | ( | const std::string & | area, | |
const std::string & | msg | |||
) | throw () |
Add a line to the log.
area | Name of the module that generated the error. | |
msg | Message to log. |
Definition at line 33 of file LogManager.cpp.
static void adchpp::Singleton< LogManager >::newInstance | ( | ) | [inline, static, inherited] |
Definition at line 42 of file Singleton.h.
void adchpp::LogManager::setEnabled | ( | bool | enabled_ | ) | [inline] |
Definition at line 43 of file LogManager.h.
References enabled.
void adchpp::LogManager::setLogFile | ( | const std::string & | fileName | ) | [inline] |
Definition at line 40 of file LogManager.h.
References logFile.
SignalLog::Signal& adchpp::LogManager::signalLog | ( | ) | [inline] |
Definition at line 47 of file LogManager.h.
References signalLog_.
friend class Singleton< LogManager > [friend] |
Definition at line 50 of file LogManager.h.
bool adchpp::LogManager::enabled [private] |
Definition at line 54 of file LogManager.h.
Referenced by getEnabled(), and setEnabled().
LogManager * adchpp::LogManager::instance = 0 [static, private] |
Definition at line 51 of file LogManager.h.
std::string adchpp::LogManager::logFile [private] |
Definition at line 53 of file LogManager.h.
Referenced by getLogFile(), and setLogFile().
FastMutex adchpp::LogManager::mtx [private] |
Definition at line 52 of file LogManager.h.
Definition at line 59 of file LogManager.h.
Referenced by signalLog().