mirror of https://github.com/gabime/spdlog.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
608 B
C
41 lines
608 B
C
![]()
12 years ago
|
|
||
|
#include <iostream>
|
||
|
#include "base_sink.h"
|
||
|
|
||
|
namespace c11log
|
||
|
{
|
||
|
namespace sinks
|
||
|
{
|
||
|
class ostream_sink:public base_sink
|
||
|
{
|
||
|
public:
|
||
|
ostream_sink(std::ostream& os):_ostream(os)
|
||
|
{}
|
||
|
|
||
|
virtual ~ostream_sink()
|
||
|
{}
|
||
|
|
||
|
protected:
|
||
|
virtual void _sink_it(const std::string& msg)
|
||
|
{
|
||
|
_ostream << msg;
|
||
|
}
|
||
|
std::ostream& _ostream;
|
||
|
|
||
|
};
|
||
|
|
||
|
class stdout_sink:public ostream_sink
|
||
|
{
|
||
|
public:
|
||
|
stdout_sink():ostream_sink(std::cout)
|
||
|
{}
|
||
|
};
|
||
|
|
||
|
class stderr_sink:public ostream_sink
|
||
|
{
|
||
|
public:
|
||
|
stderr_sink():ostream_sink(std::cerr)
|
||
|
{}
|
||
|
};
|
||
|
}
|
||
|
}
|