Skip to content

Commit

Permalink
update event ids
Browse files Browse the repository at this point in the history
  • Loading branch information
chertby committed Oct 12, 2023
1 parent 08d0de4 commit b5ab584
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions src/libp2p/Libp2p.Protocols.Ping/LogMessages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,44 @@

namespace Nethermind.Libp2p.Protocols.Ping;

/// <summary>
/// 200_000..201_099 Trace
/// 200_100..201_199 Debug
/// 200_100..202_299 Information
/// 200_100..203_399 Warning
/// 200_100..204_499 Error
/// 200_100..205_599 Critical
/// </summary>
internal static partial class LogMessages
{
private const int EventId = 200_000;

[LoggerMessage(
EventId = 200001,
EventId = EventId + 1,
EventName = nameof(ReadingPong),
Message = "Reading pong",
Level = LogLevel.Trace)]
internal static partial void ReadingPong(
this ILogger logger);

[LoggerMessage(
EventId = 200002,
EventId = EventId + 2,
EventName = nameof(VerifyingPong),
Message = "Verifying pong",
Level = LogLevel.Trace)]
internal static partial void VerifyingPong(
this ILogger logger);

[LoggerMessage(
EventId = 200003,
EventId = EventId + 3,
EventName = nameof(ReadingPing),
Message = "Reading ping",
Level = LogLevel.Trace)]
internal static partial void ReadingPing(
this ILogger logger);

[LoggerMessage(
EventId = 200004,
EventId = EventId + 4,
EventName = nameof(ReturningPong),
Message = "Returning pong",
Level = LogLevel.Trace)]
internal static partial void ReturningPong(
this ILogger logger);

[LoggerMessage(
EventId = 200101,
EventId = EventId + 5,
EventName = nameof(LogPing),
Message = "Ping {remotePeer}",
Level = LogLevel.Debug)]
Expand All @@ -58,15 +52,15 @@ internal static partial void LogPing(
Multiaddr remotePeer);

[LoggerMessage(
EventId = 200102,
EventId = EventId + 6,
EventName = nameof(LogPinged),
Message = "Pinged",
Level = LogLevel.Debug)]
internal static partial void LogPinged(
this ILogger logger);

[LoggerMessage(
EventId = 200103,
EventId = EventId + 7,
EventName = nameof(PingListenStarted),
Message = "Ping listen started from {remotePeer}",
Level = LogLevel.Debug)]
Expand All @@ -75,15 +69,15 @@ internal static partial void PingListenStarted(
Multiaddr remotePeer);

[LoggerMessage(
EventId = 200104,
EventId = EventId + 8,
EventName = nameof(PingFinished),
Message = "Ping finished",
Level = LogLevel.Debug)]
internal static partial void PingFinished(
this ILogger logger);

[LoggerMessage(
EventId = 200301,
EventId = EventId + 9,
EventName = nameof(PingFailed),
Message = "Wrong response to ping from {remotePeer}",
Level = LogLevel.Warning)]
Expand Down

0 comments on commit b5ab584

Please sign in to comment.