Skip to content

Commit

Permalink
Update logger level and flush_on values (#142)
Browse files Browse the repository at this point in the history
The logger level change is needed because the file sink's level is
`trace` and apparently `spdlog` will use the lower severity level of the logger and the sink.

The `flush_on` change is needed to cause spdlog to write to file more
frequently.

Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored Aug 28, 2024
1 parent f5eabdf commit 2b53ca8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion log/src/Logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ Logger::Logger(const std::string &_loggerName)
this->dataPtr->sinks->add_sink(this->dataPtr->consoleSink);

// Configure the logger.
this->dataPtr->logger->set_level(spdlog::level::trace);
this->dataPtr->consoleSink->set_level(spdlog::level::err);
this->dataPtr->logger->flush_on(spdlog::level::err);
this->dataPtr->logger->flush_on(spdlog::level::debug);

this->dataPtr->logger->set_formatter(this->dataPtr->formatter->clone());
}
Expand Down

0 comments on commit 2b53ca8

Please sign in to comment.