2
0
mirror of https://github.com/boostorg/redis.git synced 2026-01-19 04:42:09 +00:00

Moves all logging logic to FSMs (#335)

Replaces connection_logger by buffered_logger and log_utils.hpp
Adds a system to log arbitrary values without defining new logger methods
This commit is contained in:
Anarthal (Rubén Pérez)
2025-10-22 11:59:59 +02:00
committed by GitHub
parent 42411be444
commit 033f6aaa62
19 changed files with 227 additions and 303 deletions

View File

@@ -8,7 +8,6 @@
#include <boost/redis/config.hpp>
#include <boost/redis/detail/connect_fsm.hpp>
#include <boost/redis/detail/connection_logger.hpp>
#include <boost/redis/error.hpp>
#include <boost/redis/logger.hpp>
@@ -29,7 +28,7 @@ namespace asio = boost::asio;
using detail::connect_fsm;
using detail::connect_action_type;
using detail::connect_action;
using detail::connection_logger;
using detail::buffered_logger;
using detail::redis_stream_state;
using detail::transport_type;
using asio::ip::tcp;
@@ -105,7 +104,7 @@ auto resolver_data = [] {
// Reduce duplication
struct fixture : detail::log_fixture {
config cfg;
connection_logger lgr{make_logger()};
buffered_logger lgr{make_logger()};
connect_fsm fsm{cfg, lgr};
redis_stream_state st{};

View File

@@ -96,7 +96,7 @@ void copy_to(multiplexer& mpx, std::string_view data)
}
struct fixture : redis::detail::log_fixture {
connection_state st{make_logger()};
connection_state st{{make_logger()}};
generic_response resp;
fixture()

View File

@@ -31,7 +31,6 @@ using detail::run_action_type;
using detail::run_action;
using boost::system::error_code;
using boost::asio::cancellation_type_t;
using detail::connection_logger;
using namespace std::chrono_literals;
// Operators
@@ -86,7 +85,7 @@ struct fixture : detail::log_fixture {
}
fixture(config&& cfg = default_config())
: st{make_logger(), std::move(cfg)}
: st{{make_logger()}, std::move(cfg)}
{ }
};

View File

@@ -6,7 +6,6 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/redis/detail/connection_logger.hpp>
#include <boost/redis/detail/connection_state.hpp>
#include <boost/redis/detail/multiplexer.hpp>
#include <boost/redis/detail/writer_fsm.hpp>
@@ -36,7 +35,6 @@ using detail::writer_action;
using detail::connection_state;
using boost::system::error_code;
using boost::asio::cancellation_type_t;
using detail::connection_logger;
using namespace std::chrono_literals;
// Operators
@@ -110,7 +108,7 @@ struct test_elem {
};
struct fixture : detail::log_fixture {
connection_state st{make_logger()};
connection_state st{{make_logger()}};
writer_fsm fsm;
fixture()