#pragma once #include "Sink.h" #include #include "Formatter.h" #include #include namespace logging { enum class Level; class LevelFilter : public Sink { public: LevelFilter(std::shared_ptr innerSink, Level minLevel); void receive(const Entry& entry) override; private: std::shared_ptr innerSink; Level minLevel; }; class StreamSink : public Sink { public: StreamSink(std::shared_ptr stream, std::shared_ptr formatter); void receive(const Entry& entry) override; private: std::shared_ptr stream; std::shared_ptr formatter; }; class StdErrSink : public StreamSink { public: explicit StdErrSink(std::shared_ptr formatter); }; class PausableSink : public Sink { public: explicit PausableSink(std::shared_ptr innerSink); void receive(const Entry& entry) override; void pause(); void resume(); private: std::shared_ptr innerSink; std::vector buffer; std::mutex mutex; bool isPaused = false; }; }