mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-04 11:55:51 +00:00
feat: Do not print critical errors in stdout (#2468)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "util/log/Logger.hpp"
|
||||
|
||||
#include <spdlog/common.h>
|
||||
#include <spdlog/pattern_formatter.h>
|
||||
#include <spdlog/sinks/ostream_sink.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
@@ -35,6 +36,7 @@ LoggerFixture::LoggerFixture()
|
||||
|
||||
// Create ostream sink for testing
|
||||
auto ostreamSink = std::make_shared<spdlog::sinks::ostream_sink_mt>(stream_);
|
||||
ostreamSink->set_formatter(std::make_unique<spdlog::pattern_formatter>("%^%3!l:%n%$ - %v"));
|
||||
|
||||
// Create loggers for each channel
|
||||
std::ranges::for_each(util::Logger::kCHANNELS, [&ostreamSink](char const* channel) {
|
||||
@@ -50,8 +52,6 @@ LoggerFixture::LoggerFixture()
|
||||
spdlog::register_logger(traceLogger);
|
||||
|
||||
spdlog::set_default_logger(spdlog::get("General"));
|
||||
|
||||
spdlog::set_pattern("%^%3!l:%n%$ - %v");
|
||||
}
|
||||
|
||||
NoLoggerFixture::NoLoggerFixture()
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <fmt/format.h>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <spdlog/pattern_formatter.h>
|
||||
#include <spdlog/sinks/ostream_sink.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
@@ -84,6 +85,7 @@ protected:
|
||||
replaceSinks()
|
||||
{
|
||||
auto ostreamSink = std::make_shared<spdlog::sinks::ostream_sink_mt>(stream_);
|
||||
ostreamSink->set_formatter(std::make_unique<spdlog::pattern_formatter>("%^%3!l:%n%$ - %v"));
|
||||
|
||||
for (auto const& channel : Logger::kCHANNELS) {
|
||||
auto logger = spdlog::get(channel);
|
||||
@@ -93,8 +95,6 @@ protected:
|
||||
logger->sinks().clear();
|
||||
logger->sinks().push_back(ostreamSink);
|
||||
}
|
||||
|
||||
spdlog::set_pattern("%^%3!l:%n%$ - %v");
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user