mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-29 02:28:10 -07:00
(minor) change Bytes with Hex call in logger
This commit is contained in:
@@ -84,7 +84,7 @@ func (g *ConnectionIDGenerator) Generate(ip netip.Addr, now time.Time) []byte {
|
|||||||
log.Debug().
|
log.Debug().
|
||||||
Stringer("ip", ip).
|
Stringer("ip", ip).
|
||||||
Time("now", now).
|
Time("now", now).
|
||||||
Bytes("connID", g.connID).
|
Hex("connID", g.connID).
|
||||||
Msg("generated connection ID")
|
Msg("generated connection ID")
|
||||||
return g.connID
|
return g.connID
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ func (g *ConnectionIDGenerator) Validate(connectionID []byte, ip netip.Addr, now
|
|||||||
log.Debug().
|
log.Debug().
|
||||||
Stringer("ip", ip).
|
Stringer("ip", ip).
|
||||||
Time("ts", ts).Time("now", now).
|
Time("ts", ts).Time("now", now).
|
||||||
Bytes("connID", g.connID).
|
Hex("connID", g.connID).
|
||||||
Msg("validating connection ID")
|
Msg("validating connection ID")
|
||||||
if now.After(ts.Add(ttl)) || ts.After(now.Add(maxClockSkew)) {
|
if now.After(ts.Add(ttl)) || ts.After(now.Add(maxClockSkew)) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ func simpleNewConnectionID(ip netip.Addr, now time.Time, key string) []byte {
|
|||||||
log.Debug().
|
log.Debug().
|
||||||
Stringer("ip", ip).
|
Stringer("ip", ip).
|
||||||
Time("now", now).
|
Time("now", now).
|
||||||
Bytes("connID", buf).
|
Hex("connID", buf).
|
||||||
Msg("manually generated connection ID")
|
Msg("manually generated connection ID")
|
||||||
return buf
|
return buf
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ func (s *store) getPeers(ctx context.Context, ih bittorrent.InfoHash, seeders bo
|
|||||||
} else {
|
} else {
|
||||||
logger.Warn().
|
logger.Warn().
|
||||||
Err(err).
|
Err(err).
|
||||||
Bytes("peerID", id).
|
Hex("peerID", id).
|
||||||
IPAddr("ip", ip).
|
IPAddr("ip", ip).
|
||||||
Int("port", port).
|
Int("port", port).
|
||||||
Msg("unable to scan/construct peer")
|
Msg("unable to scan/construct peer")
|
||||||
@@ -552,7 +552,7 @@ func (s *store) countPeers(ctx context.Context, ih []byte) (seeders uint32, leec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error().Err(err).Bytes("infoHash", ih).Msg("unable to get peers count")
|
logger.Error().Err(err).Hex("infoHash", ih).Msg("unable to get peers count")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user