19 lines
381 B
C++
19 lines
381 B
C++
#include <base/stdout_sink.hpp>
|
|
|
|
namespace base {
|
|
StdoutLoggerSink& StdoutLoggerSink::The() {
|
|
static StdoutLoggerSink sink;
|
|
return sink;
|
|
}
|
|
|
|
void StdoutLoggerSink::OutputMessage(std::string_view message) {
|
|
fputs(message.data(), stdout);
|
|
fputc('\n', stdout);
|
|
fflush(stdout);
|
|
}
|
|
|
|
void LoggerAttachStdout() {
|
|
AttachSink(StdoutLoggerSink::The());
|
|
}
|
|
} // namespace base
|