From e9753fe48aad003483e93639f4e25a2cae481aa9 Mon Sep 17 00:00:00 2001 From: Andrzej Pindor Date: Mon, 29 Mar 2021 21:42:14 +0200 Subject: [PATCH 1/3] Use typed alias for RequestContextLog --- .../HttpSys/src/RequestProcessing/RequestContextOfT.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContextOfT.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContextOfT.cs index 88947e041f8c..2f95a4bbcf7a 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContextOfT.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContextOfT.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Http; +using Log = Microsoft.AspNetCore.Server.HttpSys.RequestContextLog; namespace Microsoft.AspNetCore.Server.HttpSys { @@ -51,7 +52,7 @@ protected override async Task ExecuteAsync() } catch (Exception ex) { - RequestContextLog.RequestProcessError(Logger, ex); + Log.RequestProcessError(Logger, ex); if (context != null) { application.DisposeContext(context, ex); @@ -85,14 +86,14 @@ protected override async Task ExecuteAsync() { if (messagePump.DecrementOutstandingRequest() == 0 && messagePump.Stopping) { - RequestContextLog.RequestsDrained(Logger); + Log.RequestsDrained(Logger); messagePump.SetShutdownSignal(); } } } catch (Exception ex) { - RequestContextLog.RequestError(Logger, ex); + Log.RequestError(Logger, ex); Abort(); } } From 9caabd8f35a3ef9daff74a75ac09a84ce2a0d7d6 Mon Sep 17 00:00:00 2001 From: Andrzej Pindor Date: Mon, 29 Mar 2021 21:43:13 +0200 Subject: [PATCH 2/3] Refactor HubConnectionHandler logging --- .../server/Core/src/HubConnectionHandler.cs | 52 +--------------- .../Core/src/HubConnectionHandlerLog.cs | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+), 51 deletions(-) create mode 100644 src/SignalR/server/Core/src/HubConnectionHandlerLog.cs diff --git a/src/SignalR/server/Core/src/HubConnectionHandler.cs b/src/SignalR/server/Core/src/HubConnectionHandler.cs index a16f42f490cf..ae48d8c2743c 100644 --- a/src/SignalR/server/Core/src/HubConnectionHandler.cs +++ b/src/SignalR/server/Core/src/HubConnectionHandler.cs @@ -14,6 +14,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Log = Microsoft.AspNetCore.SignalR.HubConnectionHandlerLog; namespace Microsoft.AspNetCore.SignalR { @@ -335,56 +336,5 @@ private async Task DispatchMessagesAsync(HubConnectionContext connection) } } } - - private static class Log - { - private static readonly Action _errorDispatchingHubEvent = - LoggerMessage.Define(LogLevel.Error, new EventId(1, "ErrorDispatchingHubEvent"), "Error when dispatching '{HubMethod}' on hub."); - - private static readonly Action _errorProcessingRequest = - LoggerMessage.Define(LogLevel.Debug, new EventId(2, "ErrorProcessingRequest"), "Error when processing requests."); - - private static readonly Action _abortFailed = - LoggerMessage.Define(LogLevel.Trace, new EventId(3, "AbortFailed"), "Abort callback failed."); - - private static readonly Action _errorSendingClose = - LoggerMessage.Define(LogLevel.Debug, new EventId(4, "ErrorSendingClose"), "Error when sending Close message."); - - private static readonly Action _connectedStarting = - LoggerMessage.Define(LogLevel.Debug, new EventId(5, "ConnectedStarting"), "OnConnectedAsync started."); - - private static readonly Action _connectedEnding = - LoggerMessage.Define(LogLevel.Debug, new EventId(6, "ConnectedEnding"), "OnConnectedAsync ending."); - - public static void ErrorDispatchingHubEvent(ILogger logger, string hubMethod, Exception exception) - { - _errorDispatchingHubEvent(logger, hubMethod, exception); - } - - public static void ErrorProcessingRequest(ILogger logger, Exception exception) - { - _errorProcessingRequest(logger, exception); - } - - public static void AbortFailed(ILogger logger, Exception exception) - { - _abortFailed(logger, exception); - } - - public static void ErrorSendingClose(ILogger logger, Exception exception) - { - _errorSendingClose(logger, exception); - } - - public static void ConnectedStarting(ILogger logger) - { - _connectedStarting(logger, null); - } - - public static void ConnectedEnding(ILogger logger) - { - _connectedEnding(logger, null); - } - } } } diff --git a/src/SignalR/server/Core/src/HubConnectionHandlerLog.cs b/src/SignalR/server/Core/src/HubConnectionHandlerLog.cs new file mode 100644 index 000000000000..7abaf8bbf28a --- /dev/null +++ b/src/SignalR/server/Core/src/HubConnectionHandlerLog.cs @@ -0,0 +1,61 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.SignalR.Protocol; +using Microsoft.Extensions.Internal; +using Microsoft.Extensions.Logging; + +namespace Microsoft.AspNetCore.SignalR +{ + internal static class HubConnectionHandlerLog + { + private static readonly Action _errorDispatchingHubEvent = + LoggerMessage.Define(LogLevel.Error, new EventId(1, "ErrorDispatchingHubEvent"), "Error when dispatching '{HubMethod}' on hub."); + + private static readonly Action _errorProcessingRequest = + LoggerMessage.Define(LogLevel.Debug, new EventId(2, "ErrorProcessingRequest"), "Error when processing requests."); + + private static readonly Action _abortFailed = + LoggerMessage.Define(LogLevel.Trace, new EventId(3, "AbortFailed"), "Abort callback failed."); + + private static readonly Action _errorSendingClose = + LoggerMessage.Define(LogLevel.Debug, new EventId(4, "ErrorSendingClose"), "Error when sending Close message."); + + private static readonly Action _connectedStarting = + LoggerMessage.Define(LogLevel.Debug, new EventId(5, "ConnectedStarting"), "OnConnectedAsync started."); + + private static readonly Action _connectedEnding = + LoggerMessage.Define(LogLevel.Debug, new EventId(6, "ConnectedEnding"), "OnConnectedAsync ending."); + + public static void ErrorDispatchingHubEvent(ILogger logger, string hubMethod, Exception exception) + { + _errorDispatchingHubEvent(logger, hubMethod, exception); + } + + public static void ErrorProcessingRequest(ILogger logger, Exception exception) + { + _errorProcessingRequest(logger, exception); + } + + public static void AbortFailed(ILogger logger, Exception exception) + { + _abortFailed(logger, exception); + } + + public static void ErrorSendingClose(ILogger logger, Exception exception) + { + _errorSendingClose(logger, exception); + } + + public static void ConnectedStarting(ILogger logger) + { + _connectedStarting(logger, null); + } + + public static void ConnectedEnding(ILogger logger) + { + _connectedEnding(logger, null); + } + } +} From 5739076d0bf83baea0f9a960b738a7030e086f35 Mon Sep 17 00:00:00 2001 From: Andrzej Pindor Date: Mon, 29 Mar 2021 21:43:33 +0200 Subject: [PATCH 3/3] Refactor DefaultHubDispatcher logging --- .../src/Internal/DefaultHubDispatcher.Log.cs | 199 ------------------ .../Core/src/Internal/DefaultHubDispatcher.cs | 1 + .../src/Internal/DefaultHubDispatcherLog.cs | 196 +++++++++++++++++ 3 files changed, 197 insertions(+), 199 deletions(-) delete mode 100644 src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.Log.cs create mode 100644 src/SignalR/server/Core/src/Internal/DefaultHubDispatcherLog.cs diff --git a/src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.Log.cs b/src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.Log.cs deleted file mode 100644 index 8a84bc8b882e..000000000000 --- a/src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.Log.cs +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using Microsoft.AspNetCore.SignalR.Protocol; -using Microsoft.Extensions.Internal; -using Microsoft.Extensions.Logging; - -namespace Microsoft.AspNetCore.SignalR.Internal -{ - internal partial class DefaultHubDispatcher - { - private static class Log - { - private static readonly Action _receivedHubInvocation = - LoggerMessage.Define(LogLevel.Debug, new EventId(1, "ReceivedHubInvocation"), "Received hub invocation: {InvocationMessage}."); - - private static readonly Action _unsupportedMessageReceived = - LoggerMessage.Define(LogLevel.Debug, new EventId(2, "UnsupportedMessageReceived"), "Received unsupported message of type '{MessageType}'."); - - private static readonly Action _unknownHubMethod = - LoggerMessage.Define(LogLevel.Debug, new EventId(3, "UnknownHubMethod"), "Unknown hub method '{HubMethod}'."); - - // 4, OutboundChannelClosed - removed - - private static readonly Action _hubMethodNotAuthorized = - LoggerMessage.Define(LogLevel.Debug, new EventId(5, "HubMethodNotAuthorized"), "Failed to invoke '{HubMethod}' because user is unauthorized."); - - private static readonly Action _streamingResult = - LoggerMessage.Define(LogLevel.Trace, new EventId(6, "StreamingResult"), "InvocationId {InvocationId}: Streaming result of type '{ResultType}'."); - - private static readonly Action _sendingResult = - LoggerMessage.Define(LogLevel.Trace, new EventId(7, "SendingResult"), "InvocationId {InvocationId}: Sending result of type '{ResultType}'."); - - private static readonly Action _failedInvokingHubMethod = - LoggerMessage.Define(LogLevel.Error, new EventId(8, "FailedInvokingHubMethod"), "Failed to invoke hub method '{HubMethod}'."); - - private static readonly Action _hubMethodBound = - LoggerMessage.Define(LogLevel.Trace, new EventId(9, "HubMethodBound"), "'{HubName}' hub method '{HubMethod}' is bound."); - - private static readonly Action _cancelStream = - LoggerMessage.Define(LogLevel.Debug, new EventId(10, "CancelStream"), "Canceling stream for invocation {InvocationId}."); - - private static readonly Action _unexpectedCancel = - LoggerMessage.Define(LogLevel.Debug, new EventId(11, "UnexpectedCancel"), "CancelInvocationMessage received unexpectedly."); - - private static readonly Action _receivedStreamHubInvocation = - LoggerMessage.Define(LogLevel.Debug, new EventId(12, "ReceivedStreamHubInvocation"), "Received stream hub invocation: {InvocationMessage}."); - - private static readonly Action _streamingMethodCalledWithInvoke = - LoggerMessage.Define(LogLevel.Debug, new EventId(13, "StreamingMethodCalledWithInvoke"), "A streaming method was invoked with a non-streaming invocation : {InvocationMessage}."); - - private static readonly Action _nonStreamingMethodCalledWithStream = - LoggerMessage.Define(LogLevel.Debug, new EventId(14, "NonStreamingMethodCalledWithStream"), "A non-streaming method was invoked with a streaming invocation : {InvocationMessage}."); - - private static readonly Action _invalidReturnValueFromStreamingMethod = - LoggerMessage.Define(LogLevel.Debug, new EventId(15, "InvalidReturnValueFromStreamingMethod"), "A streaming method returned a value that cannot be used to build enumerator {HubMethod}."); - - private static readonly Action _receivedStreamItem = - LoggerMessage.Define(LogLevel.Trace, new EventId(16, "ReceivedStreamItem"), "Received item for stream '{StreamId}'."); - - private static readonly Action _startingParameterStream = - LoggerMessage.Define(LogLevel.Trace, new EventId(17, "StartingParameterStream"), "Creating streaming parameter channel '{StreamId}'."); - - private static readonly Action _completingStream = - LoggerMessage.Define(LogLevel.Trace, new EventId(18, "CompletingStream"), "Stream '{StreamId}' has been completed by client."); - - private static readonly Action _closingStreamWithBindingError = - LoggerMessage.Define(LogLevel.Debug, new EventId(19, "ClosingStreamWithBindingError"), "Stream '{StreamId}' closed with error '{Error}'."); - - private static readonly Action _unexpectedStreamCompletion = - LoggerMessage.Define(LogLevel.Debug, new EventId(20, "UnexpectedStreamCompletion"), "StreamCompletionMessage received unexpectedly."); - - private static readonly Action _unexpectedStreamItem = - LoggerMessage.Define(LogLevel.Debug, new EventId(21, "UnexpectedStreamItem"), "StreamItemMessage received unexpectedly."); - - private static readonly Action _invalidHubParameters = - LoggerMessage.Define(LogLevel.Debug, new EventId(22, "InvalidHubParameters"), "Parameters to hub method '{HubMethod}' are incorrect."); - - private static readonly Action _invocationIdInUse = - LoggerMessage.Define(LogLevel.Debug, new EventId(23, "InvocationIdInUse"), "Invocation ID '{InvocationId}' is already in use."); - - public static void ReceivedHubInvocation(ILogger logger, InvocationMessage invocationMessage) - { - _receivedHubInvocation(logger, invocationMessage, null); - } - - public static void UnsupportedMessageReceived(ILogger logger, string messageType) - { - _unsupportedMessageReceived(logger, messageType, null); - } - - public static void UnknownHubMethod(ILogger logger, string hubMethod) - { - _unknownHubMethod(logger, hubMethod, null); - } - - public static void HubMethodNotAuthorized(ILogger logger, string hubMethod) - { - _hubMethodNotAuthorized(logger, hubMethod, null); - } - - public static void StreamingResult(ILogger logger, string invocationId, ObjectMethodExecutor objectMethodExecutor) - { - var resultType = objectMethodExecutor.AsyncResultType == null ? objectMethodExecutor.MethodReturnType : objectMethodExecutor.AsyncResultType; - _streamingResult(logger, invocationId, resultType.FullName!, null); - } - - public static void SendingResult(ILogger logger, string? invocationId, ObjectMethodExecutor objectMethodExecutor) - { - if (logger.IsEnabled(LogLevel.Trace)) - { - var resultType = objectMethodExecutor.AsyncResultType == null ? objectMethodExecutor.MethodReturnType : objectMethodExecutor.AsyncResultType; - _sendingResult(logger, invocationId, resultType.FullName!, null); - } - } - - public static void FailedInvokingHubMethod(ILogger logger, string hubMethod, Exception exception) - { - _failedInvokingHubMethod(logger, hubMethod, exception); - } - - public static void HubMethodBound(ILogger logger, string hubName, string hubMethod) - { - _hubMethodBound(logger, hubName, hubMethod, null); - } - - public static void CancelStream(ILogger logger, string invocationId) - { - _cancelStream(logger, invocationId, null); - } - - public static void UnexpectedCancel(ILogger logger) - { - _unexpectedCancel(logger, null); - } - - public static void ReceivedStreamHubInvocation(ILogger logger, StreamInvocationMessage invocationMessage) - { - _receivedStreamHubInvocation(logger, invocationMessage, null); - } - - public static void StreamingMethodCalledWithInvoke(ILogger logger, HubMethodInvocationMessage invocationMessage) - { - _streamingMethodCalledWithInvoke(logger, invocationMessage, null); - } - - public static void NonStreamingMethodCalledWithStream(ILogger logger, HubMethodInvocationMessage invocationMessage) - { - _nonStreamingMethodCalledWithStream(logger, invocationMessage, null); - } - - public static void InvalidReturnValueFromStreamingMethod(ILogger logger, string hubMethod) - { - _invalidReturnValueFromStreamingMethod(logger, hubMethod, null); - } - - public static void ReceivedStreamItem(ILogger logger, StreamItemMessage message) - { - _receivedStreamItem(logger, message.InvocationId!, null); - } - - public static void StartingParameterStream(ILogger logger, string streamId) - { - _startingParameterStream(logger, streamId, null); - } - - public static void CompletingStream(ILogger logger, CompletionMessage message) - { - _completingStream(logger, message.InvocationId!, null); - } - - public static void ClosingStreamWithBindingError(ILogger logger, CompletionMessage message) - { - _closingStreamWithBindingError(logger, message.InvocationId!, message.Error!, null); - } - - public static void UnexpectedStreamCompletion(ILogger logger) - { - _unexpectedStreamCompletion(logger, null); - } - - public static void UnexpectedStreamItem(ILogger logger) - { - _unexpectedStreamItem(logger, null); - } - - public static void InvalidHubParameters(ILogger logger, string hubMethod, Exception exception) - { - _invalidHubParameters(logger, hubMethod, exception); - } - - public static void InvocationIdInUse(ILogger logger, string InvocationId) - { - _invocationIdInUse(logger, InvocationId, null); - } - } - } -} diff --git a/src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.cs b/src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.cs index 6a4ea35db16c..d3d4b92dfd33 100644 --- a/src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.cs +++ b/src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.cs @@ -16,6 +16,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; +using Log = Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcherLog; namespace Microsoft.AspNetCore.SignalR.Internal { diff --git a/src/SignalR/server/Core/src/Internal/DefaultHubDispatcherLog.cs b/src/SignalR/server/Core/src/Internal/DefaultHubDispatcherLog.cs new file mode 100644 index 000000000000..2ce3d89a5f65 --- /dev/null +++ b/src/SignalR/server/Core/src/Internal/DefaultHubDispatcherLog.cs @@ -0,0 +1,196 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.SignalR.Protocol; +using Microsoft.Extensions.Internal; +using Microsoft.Extensions.Logging; + +namespace Microsoft.AspNetCore.SignalR.Internal +{ + internal static class DefaultHubDispatcherLog + { + private static readonly Action _receivedHubInvocation = + LoggerMessage.Define(LogLevel.Debug, new EventId(1, "ReceivedHubInvocation"), "Received hub invocation: {InvocationMessage}."); + + private static readonly Action _unsupportedMessageReceived = + LoggerMessage.Define(LogLevel.Debug, new EventId(2, "UnsupportedMessageReceived"), "Received unsupported message of type '{MessageType}'."); + + private static readonly Action _unknownHubMethod = + LoggerMessage.Define(LogLevel.Debug, new EventId(3, "UnknownHubMethod"), "Unknown hub method '{HubMethod}'."); + + // 4, OutboundChannelClosed - removed + + private static readonly Action _hubMethodNotAuthorized = + LoggerMessage.Define(LogLevel.Debug, new EventId(5, "HubMethodNotAuthorized"), "Failed to invoke '{HubMethod}' because user is unauthorized."); + + private static readonly Action _streamingResult = + LoggerMessage.Define(LogLevel.Trace, new EventId(6, "StreamingResult"), "InvocationId {InvocationId}: Streaming result of type '{ResultType}'."); + + private static readonly Action _sendingResult = + LoggerMessage.Define(LogLevel.Trace, new EventId(7, "SendingResult"), "InvocationId {InvocationId}: Sending result of type '{ResultType}'."); + + private static readonly Action _failedInvokingHubMethod = + LoggerMessage.Define(LogLevel.Error, new EventId(8, "FailedInvokingHubMethod"), "Failed to invoke hub method '{HubMethod}'."); + + private static readonly Action _hubMethodBound = + LoggerMessage.Define(LogLevel.Trace, new EventId(9, "HubMethodBound"), "'{HubName}' hub method '{HubMethod}' is bound."); + + private static readonly Action _cancelStream = + LoggerMessage.Define(LogLevel.Debug, new EventId(10, "CancelStream"), "Canceling stream for invocation {InvocationId}."); + + private static readonly Action _unexpectedCancel = + LoggerMessage.Define(LogLevel.Debug, new EventId(11, "UnexpectedCancel"), "CancelInvocationMessage received unexpectedly."); + + private static readonly Action _receivedStreamHubInvocation = + LoggerMessage.Define(LogLevel.Debug, new EventId(12, "ReceivedStreamHubInvocation"), "Received stream hub invocation: {InvocationMessage}."); + + private static readonly Action _streamingMethodCalledWithInvoke = + LoggerMessage.Define(LogLevel.Debug, new EventId(13, "StreamingMethodCalledWithInvoke"), "A streaming method was invoked with a non-streaming invocation : {InvocationMessage}."); + + private static readonly Action _nonStreamingMethodCalledWithStream = + LoggerMessage.Define(LogLevel.Debug, new EventId(14, "NonStreamingMethodCalledWithStream"), "A non-streaming method was invoked with a streaming invocation : {InvocationMessage}."); + + private static readonly Action _invalidReturnValueFromStreamingMethod = + LoggerMessage.Define(LogLevel.Debug, new EventId(15, "InvalidReturnValueFromStreamingMethod"), "A streaming method returned a value that cannot be used to build enumerator {HubMethod}."); + + private static readonly Action _receivedStreamItem = + LoggerMessage.Define(LogLevel.Trace, new EventId(16, "ReceivedStreamItem"), "Received item for stream '{StreamId}'."); + + private static readonly Action _startingParameterStream = + LoggerMessage.Define(LogLevel.Trace, new EventId(17, "StartingParameterStream"), "Creating streaming parameter channel '{StreamId}'."); + + private static readonly Action _completingStream = + LoggerMessage.Define(LogLevel.Trace, new EventId(18, "CompletingStream"), "Stream '{StreamId}' has been completed by client."); + + private static readonly Action _closingStreamWithBindingError = + LoggerMessage.Define(LogLevel.Debug, new EventId(19, "ClosingStreamWithBindingError"), "Stream '{StreamId}' closed with error '{Error}'."); + + private static readonly Action _unexpectedStreamCompletion = + LoggerMessage.Define(LogLevel.Debug, new EventId(20, "UnexpectedStreamCompletion"), "StreamCompletionMessage received unexpectedly."); + + private static readonly Action _unexpectedStreamItem = + LoggerMessage.Define(LogLevel.Debug, new EventId(21, "UnexpectedStreamItem"), "StreamItemMessage received unexpectedly."); + + private static readonly Action _invalidHubParameters = + LoggerMessage.Define(LogLevel.Debug, new EventId(22, "InvalidHubParameters"), "Parameters to hub method '{HubMethod}' are incorrect."); + + private static readonly Action _invocationIdInUse = + LoggerMessage.Define(LogLevel.Debug, new EventId(23, "InvocationIdInUse"), "Invocation ID '{InvocationId}' is already in use."); + + public static void ReceivedHubInvocation(ILogger logger, InvocationMessage invocationMessage) + { + _receivedHubInvocation(logger, invocationMessage, null); + } + + public static void UnsupportedMessageReceived(ILogger logger, string messageType) + { + _unsupportedMessageReceived(logger, messageType, null); + } + + public static void UnknownHubMethod(ILogger logger, string hubMethod) + { + _unknownHubMethod(logger, hubMethod, null); + } + + public static void HubMethodNotAuthorized(ILogger logger, string hubMethod) + { + _hubMethodNotAuthorized(logger, hubMethod, null); + } + + public static void StreamingResult(ILogger logger, string invocationId, ObjectMethodExecutor objectMethodExecutor) + { + var resultType = objectMethodExecutor.AsyncResultType == null ? objectMethodExecutor.MethodReturnType : objectMethodExecutor.AsyncResultType; + _streamingResult(logger, invocationId, resultType.FullName!, null); + } + + public static void SendingResult(ILogger logger, string? invocationId, ObjectMethodExecutor objectMethodExecutor) + { + if (logger.IsEnabled(LogLevel.Trace)) + { + var resultType = objectMethodExecutor.AsyncResultType == null ? objectMethodExecutor.MethodReturnType : objectMethodExecutor.AsyncResultType; + _sendingResult(logger, invocationId, resultType.FullName!, null); + } + } + + public static void FailedInvokingHubMethod(ILogger logger, string hubMethod, Exception exception) + { + _failedInvokingHubMethod(logger, hubMethod, exception); + } + + public static void HubMethodBound(ILogger logger, string hubName, string hubMethod) + { + _hubMethodBound(logger, hubName, hubMethod, null); + } + + public static void CancelStream(ILogger logger, string invocationId) + { + _cancelStream(logger, invocationId, null); + } + + public static void UnexpectedCancel(ILogger logger) + { + _unexpectedCancel(logger, null); + } + + public static void ReceivedStreamHubInvocation(ILogger logger, StreamInvocationMessage invocationMessage) + { + _receivedStreamHubInvocation(logger, invocationMessage, null); + } + + public static void StreamingMethodCalledWithInvoke(ILogger logger, HubMethodInvocationMessage invocationMessage) + { + _streamingMethodCalledWithInvoke(logger, invocationMessage, null); + } + + public static void NonStreamingMethodCalledWithStream(ILogger logger, HubMethodInvocationMessage invocationMessage) + { + _nonStreamingMethodCalledWithStream(logger, invocationMessage, null); + } + + public static void InvalidReturnValueFromStreamingMethod(ILogger logger, string hubMethod) + { + _invalidReturnValueFromStreamingMethod(logger, hubMethod, null); + } + + public static void ReceivedStreamItem(ILogger logger, StreamItemMessage message) + { + _receivedStreamItem(logger, message.InvocationId!, null); + } + + public static void StartingParameterStream(ILogger logger, string streamId) + { + _startingParameterStream(logger, streamId, null); + } + + public static void CompletingStream(ILogger logger, CompletionMessage message) + { + _completingStream(logger, message.InvocationId!, null); + } + + public static void ClosingStreamWithBindingError(ILogger logger, CompletionMessage message) + { + _closingStreamWithBindingError(logger, message.InvocationId!, message.Error!, null); + } + + public static void UnexpectedStreamCompletion(ILogger logger) + { + _unexpectedStreamCompletion(logger, null); + } + + public static void UnexpectedStreamItem(ILogger logger) + { + _unexpectedStreamItem(logger, null); + } + + public static void InvalidHubParameters(ILogger logger, string hubMethod, Exception exception) + { + _invalidHubParameters(logger, hubMethod, exception); + } + + public static void InvocationIdInUse(ILogger logger, string InvocationId) + { + _invocationIdInUse(logger, InvocationId, null); + } + } +}