From 594d6897525f902c457428bbbc5bc9fe20305fb8 Mon Sep 17 00:00:00 2001 From: OEOTYAN Date: Thu, 9 Jan 2025 23:01:59 +0800 Subject: [PATCH] feat: add some api to logger --- src/ll/api/io/Logger.cpp | 4 ++++ src/ll/api/io/Logger.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/ll/api/io/Logger.cpp b/src/ll/api/io/Logger.cpp index a1cfe4613f..b7a2b16ac5 100644 --- a/src/ll/api/io/Logger.cpp +++ b/src/ll/api/io/Logger.cpp @@ -51,6 +51,10 @@ Logger::Logger(PrivateTag, std::string_view title) : impl(std::make_unique impl->sinks.push_back(std::make_shared()); } +std::string const& Logger::getTitle() { return impl->title; } + +LogLevel Logger::getLevel() { return impl->level; } + void Logger::printView(LogLevel level, std::string_view msg) const noexcept { if (level > impl->level) { return; diff --git a/src/ll/api/io/Logger.h b/src/ll/api/io/Logger.h index 71d2c49c88..301457f868 100644 --- a/src/ll/api/io/Logger.h +++ b/src/ll/api/io/Logger.h @@ -111,6 +111,10 @@ class Logger : public std::enable_shared_from_this { explicit Logger(PrivateTag, std::string_view); + LLNDAPI std::string const& getTitle(); + + LLNDAPI LogLevel getLevel(); + LLAPI void setLevel(LogLevel level); LLAPI void setFlushLevel(LogLevel level);