Skip to content

Commit

Permalink
Improve logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd committed Nov 10, 2023
1 parent c863821 commit 15c6fad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/grpc_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ nuraft::ptr< nuraft::rpc_client > grpc_factory::create_client(peer_id_t const& c
if (!happened) {
LOGD("Re-creating client for {}", client);
if (auto err = reinit_client(client, it->second); nuraft::OK != err) {
LOGE("Failed to re-initialize client {}: {}", client, err);
LOGW("Failed to re-initialize client {}: {}", client, err);
new_client = std::make_shared< grpc_error_client >();
} else {
new_client = it->second;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ if (jungle_FOUND)
GTest::gmock
)

add_test(NAME MessagingTest COMMAND messaging_test -cv 0)
add_test(NAME MessagingTest COMMAND messaging_test -cv 4)
set_property(TEST MessagingTest PROPERTY RUN_SERIAL 1)
endif ()
4 changes: 3 additions & 1 deletion src/tests/MessagingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class TestApplication : public MessagingApplication, public std::enable_shared_f
uint32_t port_;
boost::uuids::uuid id_;
std::shared_ptr< Manager > instance_;
bool data_svc_;

std::map< group_id_t, std::shared_ptr< test_state_mgr > > state_mgr_map_;

Expand All @@ -70,7 +71,7 @@ class TestApplication : public MessagingApplication, public std::enable_shared_f
auto [it, happened] =
state_mgr_map_.try_emplace(group_id, std::make_shared< test_state_mgr >(srv_id, id_, group_id));
RELEASE_ASSERT(happened, "Failed!");
it->second->register_data_service_apis(instance_.get());
if (data_svc_) it->second->register_data_service_apis(instance_.get());
return std::static_pointer_cast< mesg_state_mgr >(it->second);
}

Expand All @@ -80,6 +81,7 @@ class TestApplication : public MessagingApplication, public std::enable_shared_f
}

void start(bool data_svc_enabled = false) {
data_svc_ = data_svc_enabled;
auto params = Manager::Params();
params.server_uuid_ = id_;
params.mesg_port_ = port_;
Expand Down

0 comments on commit 15c6fad

Please sign in to comment.