Lugdunum  0.1.0
OstreamHandler.cpp
Go to the documentation of this file.
1 #include <iostream>
4 
5 namespace lug {
6 namespace System {
7 namespace Logger {
8 
9 OstreamHandler::OstreamHandler(const std::string& name, std::ostream& out) : Handler(name), _os(out) {}
10 
11 void OstreamHandler::handle(const priv::Message& msg) {
12  _os << msg.formatted.c_str();
13 }
14 
16  _os << std::flush;
17 }
18 
19 StdoutHandler::StdoutHandler(const std::string& name) : OstreamHandler(name, std::cout) {}
20 StderrHandler::StderrHandler(const std::string& name) : OstreamHandler(name, std::cerr) {}
21 
22 } // Logger
23 } // System
24 } // lug
StderrHandler(const std::string &name)
StdoutHandler(const std::string &name)
void handle(const priv::Message &msg) final
OstreamHandler(const std::string &name, std::ostream &out)