From fd2e84640b2be52f97f48d818d26fc1289a50c7a Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 19 Oct 2021 22:33:01 +0800 Subject: ... --- include/cru/common/Logger.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/cru/common/Logger.hpp') diff --git a/include/cru/common/Logger.hpp b/include/cru/common/Logger.hpp index 3dabeb91..7d43fc5a 100644 --- a/include/cru/common/Logger.hpp +++ b/include/cru/common/Logger.hpp @@ -94,4 +94,20 @@ void TagError(StringView tag, TArgs&&... args) { Logger::GetInstance()->Log(LogLevel::Error, tag, Format(std::forward(args)...)); } + +class StdioLogSource : public Object, public virtual ILogSource { + public: + explicit StdioLogSource(bool use_lock = false); + + CRU_DELETE_COPY(StdioLogSource) + CRU_DELETE_MOVE(StdioLogSource) + + ~StdioLogSource() override; + + public: + void Write(LogLevel level, StringView s) override; + + private: + bool use_lock_; +}; } // namespace cru::log -- cgit v1.2.3