You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
429 B

5 years ago
#ifndef LOGGER_HPP
#define LOGGER_HPP
#include <ostream>
#include <utility> // move
#include "Singleton_DCLP.hpp"
class Logger : public Singleton_DCLP<Logger>
{
public:
void setStream(std::ostream* os) { m_os = os; }
std::ostream* getStream() { return m_os; }
private:
// ostreams are not copyable, hence storing a pointer only
std::ostream* m_os;
};
#define LOG *Logger::getInstance()->getStream()
#endif // LOGGER_HPP