Skip to content

Commit

Permalink
feat: add some api to logger
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Jan 9, 2025
1 parent b4ce48d commit 594d689
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ll/api/io/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Logger::Logger(PrivateTag, std::string_view title) : impl(std::make_unique<Impl>
impl->sinks.push_back(std::make_shared<DefaultSink>());
}

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;
Expand Down
4 changes: 4 additions & 0 deletions src/ll/api/io/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ class Logger : public std::enable_shared_from_this<Logger> {

explicit Logger(PrivateTag, std::string_view);

LLNDAPI std::string const& getTitle();

LLNDAPI LogLevel getLevel();

LLAPI void setLevel(LogLevel level);

LLAPI void setFlushLevel(LogLevel level);
Expand Down

0 comments on commit 594d689

Please sign in to comment.