Skip to content

Commit

Permalink
fix log warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
laolarou726 committed Dec 26, 2023
1 parent b85f29d commit ac88555
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Hive.Both.General/Dispatchers/DefaultDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ internal static partial class DefaultDispatcherLoggers
[LoggerMessage(LogLevel.Warning, "Listen once canceled, handlerId:{HandlerId}")]
public static partial void LogListenOnceCanceled(this ILogger logger, HandlerId handlerId);

[LoggerMessage(LogLevel.Error, "{ex} Listen once failed, handlerId:{HandlerId}")]
[LoggerMessage(LogLevel.Error, "Listen once failed, handlerId:{HandlerId}")]
public static partial void LogListenOnceFailed(this ILogger logger, Exception ex, HandlerId handlerId);

[LoggerMessage(LogLevel.Trace, "Listen once removed handler, handlerId:{HandlerId}")]
Expand Down
2 changes: 1 addition & 1 deletion Hive.Network.Kcp/KcpAcceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ internal static partial class KcpAcceptorLoggers
[LoggerMessage(LogLevel.Error, "Enter read lock failed.")]
public static partial void LogEnterReadLockFailed(this ILogger logger);

[LoggerMessage(LogLevel.Error, "{ex} Accept failed.")]
[LoggerMessage(LogLevel.Error, "Accept failed.")]
public static partial void LogAcceptFailed(this ILogger logger, Exception ex);
}
}
2 changes: 1 addition & 1 deletion Hive.Network.Kcp/KcpClientSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public override void Close()

internal static partial class KcpClientSessionLoggers
{
[LoggerMessage(LogLevel.Error, "{ex} KCP raw receive loop failed!")]
[LoggerMessage(LogLevel.Error, "KCP raw receive loop failed!")]
public static partial void LogKcpRawReceiveLoopFailed(this ILogger logger, Exception ex);
}
}
2 changes: 1 addition & 1 deletion Hive.Network.Kcp/KcpConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public KcpConnector(

internal static partial class KcpConnectorLoggers
{
[LoggerMessage(LogLevel.Error, "{ex} [KCP_CONN] Connect to {RemoteEndPoint} failed")]
[LoggerMessage(LogLevel.Error, "[KCP_CONN] Connect to {RemoteEndPoint} failed")]
public static partial void LogConnectFailed(this ILogger logger, Exception ex, IPEndPoint remoteEndPoint);
}
}
2 changes: 1 addition & 1 deletion Hive.Network.Quic/QuicConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ public int GetNextSessionId()
[RequiresPreviewFeatures]
internal static partial class QuicConnectorLoggers
{
[LoggerMessage(LogLevel.Error, "{ex} Connect to {remote} failed")]
[LoggerMessage(LogLevel.Error, "Connect to {remote} failed")]
public static partial void LogConnectFailed(this ILogger logger, Exception ex, IPEndPoint remote);
}
6 changes: 3 additions & 3 deletions Hive.Network.Shared/Session/AbstractAcceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ protected int GetNextSessionId()

internal static partial class AbstractAcceptorLoggers
{
[LoggerMessage(LogLevel.Warning, "{ex} Accept loop canceled")]
[LoggerMessage(LogLevel.Warning, "Accept loop canceled")]
public static partial void LogAcceptLoopCanceled(this ILogger logger, Exception ex);

[LoggerMessage(LogLevel.Error, "{ex} Accept loop error")]
[LoggerMessage(LogLevel.Error, "Accept loop error")]
public static partial void LogAcceptLoopError(this ILogger logger, Exception ex);

[LoggerMessage(LogLevel.Debug, "Session {sessionId} heartbeat timeout.")]
Expand All @@ -192,7 +192,7 @@ internal static partial class AbstractAcceptorLoggers
[LoggerMessage(LogLevel.Information, "Session {sessionId} accepted.")]
public static partial void LogSessionAccepted(this ILogger logger, SessionId sessionId);

[LoggerMessage(LogLevel.Error, "{ex} OnSessionCreateAsync error")]
[LoggerMessage(LogLevel.Error, "OnSessionCreateAsync error")]
public static partial void LogOnSessionCreateAsyncError(this ILogger logger, Exception ex);

[LoggerMessage(LogLevel.Information, "Session {SessionId} closed")]
Expand Down
2 changes: 1 addition & 1 deletion Hive.Network.Tcp/TcpConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public int GetNextSessionId()

internal static partial class TcpConnectorLoggers
{
[LoggerMessage(LogLevel.Error, "{ex} [TCP_CONN] Connect to {RemoteEndPoint} failed")]
[LoggerMessage(LogLevel.Error, "[TCP_CONN] Connect to {RemoteEndPoint} failed")]
public static partial void LogConnectFailed(this ILogger logger, Exception ex, IPEndPoint remoteEndPoint);
}
}
2 changes: 1 addition & 1 deletion Hive.Network.Udp/UdpAcceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ internal static partial class UdpAcceptorLoggers
[LoggerMessage(LogLevel.Error, "Enter read lock failed.")]
public static partial void LogEnterReadLockFailed(this ILogger logger);

[LoggerMessage(LogLevel.Error, "{ex} Accept failed.")]
[LoggerMessage(LogLevel.Error, "Accept failed.")]
public static partial void LogAcceptFailed(this ILogger logger, Exception ex);
}
}
2 changes: 1 addition & 1 deletion Hive.Network.Udp/UdpConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public UdpConnector(

internal static partial class UdpConnectorLoggers
{
[LoggerMessage(LogLevel.Error, "{ex} [UDP_CONN] Connect to {RemoteEndPoint} failed")]
[LoggerMessage(LogLevel.Error, "[UDP_CONN] Connect to {RemoteEndPoint} failed")]
public static partial void LogConnectFailed(this ILogger logger, Exception ex, IPEndPoint remoteEndPoint);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#define GENERATE_BY_TEMPLATE

using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Microsoft.CodeAnalysis;
Expand Down

0 comments on commit ac88555

Please sign in to comment.