18 virtual std::ostream&
log() noexcept = 0;
32 explicit StreamSink(std::ostream& _os): os(_os.rdbuf()) {}
33 std::ostream&
log() noexcept
override {
return os; }
48 explicit FileSink(
const std::string& filename): os(filename, std::ios::out) {}
49 std::ostream&
log() noexcept
override {
return os; }
Contains a custom logging facility.
Base class for a logging sink.
virtual std::ostream & log() noexcept=0
Abstract logging interface.
Logging sink that wraps an arbitrary std::ostream.
std::ostream os
Output stream.
std::ostream & log() noexcept override
Abstract logging interface.
StreamSink(std::ostream &_os)
Create a StreamSink from some output stream.
Logging sink for file output.
std::ofstream os
File output stream.
std::ostream & log() noexcept override
Abstract logging interface.
FileSink(const std::string &filename)
Create a FileSink that logs to the specified file.
virtual ~FileSink()=default