SSX3LobbyServer/lib/base/stdout_sink.cpp

19 lines
381 B
C++
Raw Permalink Normal View History

#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