#ifndef __JLOGGER__JSTREAMLOGGER__ #define __JLOGGER__JSTREAMLOGGER__ #include #include "JLogger/JLogger.hh" /** * \author mdejong */ namespace JLOGGER {} namespace JPP { using namespace JLOGGER; } namespace JLOGGER { /** * Message logging based on std::ostream. * This class implements the JLogger interface. */ class JStreamLogger : public JLogger { public: /** * Constructor. * * \param __out output stream */ JStreamLogger(std::ostream& __out) : out(__out) {} /** * Report message * * \param tag tag * \param message message */ virtual void typeout(const std::string& tag, const std::string& message) override { out << tag << ' ' << message << std::endl; } protected: std::ostream& out; }; } #endif