Skip to content

Commit

Permalink
Merge pull request #14 from nenoNaninu/change_log_placeholder
Browse files Browse the repository at this point in the history
Change log placeholder name
  • Loading branch information
nenoNaninu authored Feb 2, 2024
2 parents ef5cc9c + 1f63548 commit 8feae71
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/AspNetCore.SignalR.OpenTelemetry/Internal/HubLogger.cs
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());
}
}

0 comments on commit 8feae71

Please sign in to comment.