-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from nenoNaninu/change_log_placeholder
Change log placeholder name
- Loading branch information
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
24 changes: 12 additions & 12 deletions
24
src/AspNetCore.SignalR.OpenTelemetry/Internal/HubLogger.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
using System; | ||
using System; | ||
using Microsoft.AspNetCore.Http.Connections; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace AspNetCore.SignalR.OpenTelemetry.Internal; | ||
|
||
internal static partial class HubLogger | ||
{ | ||
[LoggerMessage(8200, LogLevel.Information, "SignalR connection established to {HubName} over {TransportType}")] | ||
public static partial void LogOnConnected(ILogger logger, string hubName, HttpTransportType transportType); | ||
[LoggerMessage(8200, LogLevel.Information, "SignalR connection established to {Hub} over {TransportType}")] | ||
public static partial void LogOnConnected(ILogger logger, string hub, HttpTransportType transportType); | ||
|
||
[LoggerMessage(8201, LogLevel.Information, "Invoking the SignalR hub method {HubName}.{MethodName}")] | ||
public static partial void LogHubMethodInvocation(ILogger logger, string hubName, string methodName); | ||
[LoggerMessage(8201, LogLevel.Information, "Invoking the SignalR hub method {Hub}.{HubMethod}")] | ||
public static partial void LogHubMethodInvocation(ILogger logger, string hub, string hubMethod); | ||
|
||
[LoggerMessage(8202, LogLevel.Information, "Duration: {Duration}ms")] | ||
public static partial void LogHubMethodInvocationDuration(ILogger logger, double duration); | ||
|
||
[LoggerMessage(8208, LogLevel.Information, "SignalR connection to {HubName} was disconnected")] | ||
public static partial void LogOnDisconnected(ILogger logger, string hubName); | ||
[LoggerMessage(8208, LogLevel.Information, "SignalR connection to {Hub} was disconnected")] | ||
public static partial void LogOnDisconnected(ILogger logger, string hub); | ||
|
||
[LoggerMessage(8209, LogLevel.Information, "SignalR connection to {HubName} was disconnected with exception")] | ||
public static partial void LogOnDisconnectedWithError(ILogger logger, string hubName, Exception exception); | ||
[LoggerMessage(8209, LogLevel.Information, "SignalR connection to {Hub} was disconnected with exception")] | ||
public static partial void LogOnDisconnectedWithError(ILogger logger, string hub, Exception exception); | ||
|
||
private static readonly Func<ILogger, string, string, Guid, IDisposable?> BeginHubMethodInvocationScopeCallback | ||
= LoggerMessage.DefineScope<string, string, Guid>("HubName:{HubName}, MethodName:{MethodName}, InvocationId:{InvocationId}"); | ||
= LoggerMessage.DefineScope<string, string, Guid>("Hub:{Hub}, HubMethod:{HubMethod}, HubInvocationId:{HubInvocationId}"); | ||
|
||
public static IDisposable? BeginHubMethodInvocationScope(ILogger logger, string hubName, string methodName) | ||
public static IDisposable? BeginHubMethodInvocationScope(ILogger logger, string hub, string hubMethod) | ||
{ | ||
return BeginHubMethodInvocationScopeCallback(logger, hubName, methodName, Guid.NewGuid()); | ||
return BeginHubMethodInvocationScopeCallback(logger, hub, hubMethod, Guid.NewGuid()); | ||
} | ||
} |