Skip to content

Commit

Permalink
Change log level (#1319)
Browse files Browse the repository at this point in the history
Fix #1205
  • Loading branch information
cindyyan317 authored Apr 8, 2024
1 parent 48b0a76 commit 8095e68
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/feed/impl/ProposedTransactionFeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ProposedTransactionFeed::sub(SubscriberSharedPtr const& subscriber)
});

if (added) {
LOG(logger_.debug()) << subscriber->tag() << "Subscribed tx_proposed";
LOG(logger_.info()) << subscriber->tag() << "Subscribed tx_proposed";
++subAllCount_.get();
subscriber->onDisconnect.connect([this](SubscriberPtr connection) { unsubInternal(connection); });
}
Expand All @@ -72,7 +72,7 @@ ProposedTransactionFeed::sub(ripple::AccountID const& account, SubscriberSharedP
}
);
if (added) {
LOG(logger_.debug()) << subscriber->tag() << "Subscribed accounts_proposed " << account;
LOG(logger_.info()) << subscriber->tag() << "Subscribed accounts_proposed " << account;
++subAccountCount_.get();
subscriber->onDisconnect.connect([this, account](SubscriberPtr connection) {
unsubInternal(account, connection);
Expand Down Expand Up @@ -129,7 +129,7 @@ void
ProposedTransactionFeed::unsubInternal(SubscriberPtr subscriber)
{
if (signal_.disconnect(subscriber)) {
LOG(logger_.debug()) << subscriber->tag() << "Unsubscribed tx_proposed";
LOG(logger_.info()) << subscriber->tag() << "Unsubscribed tx_proposed";
--subAllCount_.get();
}
}
Expand All @@ -138,7 +138,7 @@ void
ProposedTransactionFeed::unsubInternal(ripple::AccountID const& account, SubscriberPtr subscriber)
{
if (accountSignal_.disconnect(subscriber, account)) {
LOG(logger_.debug()) << subscriber->tag() << "Unsubscribed accounts_proposed " << account;
LOG(logger_.info()) << subscriber->tag() << "Unsubscribed accounts_proposed " << account;
--subAccountCount_.get();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/feed/impl/SingleFeedBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SingleFeedBase::sub(SubscriberSharedPtr const& subscriber)
});

if (added) {
LOG(logger_.debug()) << subscriber->tag() << "Subscribed " << name_;
LOG(logger_.info()) << subscriber->tag() << "Subscribed " << name_;
++subCount_.get();
subscriber->onDisconnect.connect([this](SubscriberPtr connectionDisconnecting) {
unsubInternal(connectionDisconnecting);
Expand Down Expand Up @@ -83,7 +83,7 @@ void
SingleFeedBase::unsubInternal(SubscriberPtr subscriber)
{
if (signal_.disconnect(subscriber)) {
LOG(logger_.debug()) << subscriber->tag() << "Unsubscribed " << name_;
LOG(logger_.info()) << subscriber->tag() << "Unsubscribed " << name_;
--subCount_.get();
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/feed/impl/TransactionFeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ TransactionFeed::sub(SubscriberSharedPtr const& subscriber, std::uint32_t const
{
auto const added = signal_.connectTrackableSlot(subscriber, TransactionSlot(*this, subscriber));
if (added) {
LOG(logger_.debug()) << subscriber->tag() << "Subscribed transactions";
LOG(logger_.info()) << subscriber->tag() << "Subscribed transactions";
++subAllCount_.get();
subscriber->apiSubVersion = apiVersion;
subscriber->onDisconnect.connect([this](SubscriberPtr connection) { unsubInternal(connection); });
Expand All @@ -90,7 +90,7 @@ TransactionFeed::sub(
{
auto const added = accountSignal_.connectTrackableSlot(subscriber, account, TransactionSlot(*this, subscriber));
if (added) {
LOG(logger_.debug()) << subscriber->tag() << "Subscribed account " << account;
LOG(logger_.info()) << subscriber->tag() << "Subscribed account " << account;
++subAccountCount_.get();
subscriber->apiSubVersion = apiVersion;
subscriber->onDisconnect.connect([this, account](SubscriberPtr connection) {
Expand All @@ -104,7 +104,7 @@ TransactionFeed::sub(ripple::Book const& book, SubscriberSharedPtr const& subscr
{
auto const added = bookSignal_.connectTrackableSlot(subscriber, book, TransactionSlot(*this, subscriber));
if (added) {
LOG(logger_.debug()) << subscriber->tag() << "Subscribed book " << book;
LOG(logger_.info()) << subscriber->tag() << "Subscribed book " << book;
++subBookCount_.get();
subscriber->apiSubVersion = apiVersion;
subscriber->onDisconnect.connect([this, book](SubscriberPtr connection) { unsubInternal(book, connection); });
Expand Down Expand Up @@ -278,7 +278,7 @@ void
TransactionFeed::unsubInternal(SubscriberPtr subscriber)
{
if (signal_.disconnect(subscriber)) {
LOG(logger_.debug()) << subscriber->tag() << "Unsubscribed transactions";
LOG(logger_.info()) << subscriber->tag() << "Unsubscribed transactions";
--subAllCount_.get();
}
}
Expand All @@ -287,7 +287,7 @@ void
TransactionFeed::unsubInternal(ripple::AccountID const& account, SubscriberPtr subscriber)
{
if (accountSignal_.disconnect(subscriber, account)) {
LOG(logger_.debug()) << subscriber->tag() << "Unsubscribed account " << account;
LOG(logger_.info()) << subscriber->tag() << "Unsubscribed account " << account;
--subAccountCount_.get();
}
}
Expand All @@ -296,7 +296,7 @@ void
TransactionFeed::unsubInternal(ripple::Book const& book, SubscriberPtr subscriber)
{
if (bookSignal_.disconnect(subscriber, book)) {
LOG(logger_.debug()) << subscriber->tag() << "Unsubscribed book " << book;
LOG(logger_.info()) << subscriber->tag() << "Unsubscribed book " << book;
--subBookCount_.get();
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/web/impl/WsBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ class WsBase : public ConnectionBase, public std::enable_shared_from_this<WsBase
void
wsFail(boost::beast::error_code ec, char const* what)
{
LOG(perfLog_.error()) << tag() << ": " << what << ": " << ec.message();
// Don't log if the WebSocket stream was gracefully closed at both endpoints
if (ec != boost::beast::websocket::error::closed) {
LOG(perfLog_.error()) << tag() << ": " << what << ": " << ec.message() << ": " << ec.value();
}

if (!ec_ && ec != boost::asio::error::operation_aborted) {
ec_ = ec;
boost::beast::get_lowest_layer(derived().ws()).socket().close(ec);
Expand Down

0 comments on commit 8095e68

Please sign in to comment.