refactor: second log of UTP errors as 'trace' messages (#4283)

This commit is contained in:
A Cœur 2022-12-01 04:06:08 +08:00 committed by GitHub
parent f03fc9270b
commit e038121857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -1092,7 +1092,7 @@ static void gotError(tr_peerIo* io, short what, void* vhandshake)
{
tr_logAddTraceHand(
handshake,
fmt::format("libevent got an error what=={}, errno={} ({})", what, errcode, tr_strerror(errcode)));
fmt::format("libevent got an error: what={:d}, errno={:d} ({:s})", what, errcode, tr_strerror(errcode)));
tr_handshakeDone(handshake, false);
}
}

View File

@ -2151,8 +2151,14 @@ static void gotError(tr_peerIo* io, short what, void* vmsgs)
{
logdbg(msgs, fmt::format("peer closed connection. {:s}", io->addrStr()));
}
else if (what == BEV_EVENT_ERROR)
{
// exact BEV_EVENT_ERROR are high frequency errors from utp_on_error which were already logged appropriately
logtrace(msgs, fmt::format("libevent got an error! what={:d}, errno={:d} ({:s})", what, errno, tr_strerror(errno)));
}
else if ((what & BEV_EVENT_ERROR) != 0)
{
// read or write error
logdbg(msgs, fmt::format("libevent got an error! what={:d}, errno={:d} ({:s})", what, errno, tr_strerror(errno)));
}