C_CPP/08_PTRN/MP/Logger.cpp

16 lines
355 B
C++
Raw Normal View History

2018-03-09 09:47:53 +01:00
// file Logger.cpp
#include "Logger.hpp"
Logger* Logger::_theInstance = nullptr;
Logger* Logger::getInstance(){
if (!_theInstance){
_theInstance = new StdoutLogger();
}
return _theInstance;
}
void StdoutLogger::log(std::string message, std::string file, int line){
std::cerr << message << " in " << file << " line " << line << std::endl;
}