Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/errorlogger.cpp

    red58ad rc5f836  
    99#include "errorlogger.hpp"
    1010#include "verbose.hpp"
    11 #include "Patterns/Singleton_impl.hpp"
    1211
    1312ofstream null("/dev/null");
     13
     14errorLogger* errorLogger::instance = NULL;
    1415int errorLogger::verbosity = 2;
    1516ostream* errorLogger::nix = &null;
     
    2223errorLogger::errorLogger()
    2324{
     25  instance = NULL;
    2426  verbosity = 2;
    2527};
     
    3234}
    3335
    34 CONSTRUCT_SINGLETON(errorLogger)
     36/**
     37 * Returns the singleton errorLogger instance.
     38 *
     39 * \return errorLogger instance
     40 */
     41errorLogger* errorLogger::getInstance() {
     42  if (instance == NULL) {
     43    instance = new errorLogger();
     44  }
     45
     46  return instance;
     47}
     48
     49
     50/**
     51 * Purges the current errorLogger instance.
     52 */
     53void errorLogger::purgeInstance() {
     54  if (instance != NULL) {
     55    delete instance;
     56  }
     57
     58  instance = NULL;
     59}
    3560
    3661/**
Note: See TracChangeset for help on using the changeset viewer.