Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log warnings #2043

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ripple/app/ledger/Ledger.cpp
Expand Up @@ -942,6 +942,8 @@ static bool saveValidatedLedger (
JLOG (j.warn())
<< "Transaction in ledger " << seq
<< " affects no accounts";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if you don't actually need a distinct log record for this JSON, you could just add it to the line above with a "\n" since they are at the same level. Looks fine to me either way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I've seen other JSON dumps go on their own line in some other spots of the log, but I'm not sure if that is universal.

JLOG (j.warn())
<< vt.second->getTxn()->getJson(0);
}

*db <<
Expand Down
4 changes: 2 additions & 2 deletions src/ripple/overlay/impl/PeerImp.cpp
Expand Up @@ -442,7 +442,7 @@ PeerImp::fail(std::string const& reason)
shared_from_this(), reason));
if (socket_.is_open())
{
JLOG (journal_.debug()) << reason;
JLOG (journal_.warn()) << reason;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to make the same change on L456, or is that not relevant?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! 🤦‍♂️

}
close();
}
Expand All @@ -453,7 +453,7 @@ PeerImp::fail(std::string const& name, error_code ec)
assert(strand_.running_in_this_thread());
if (socket_.is_open())
{
JLOG(journal_.debug()) << name << ": " << ec.message();
JLOG(journal_.warn()) << name << ": " << ec.message();
}
close();
}
Expand Down