From 71e2f4545075aba39b24726f7defa0bb64b647e1 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Tue, 6 Nov 2018 09:24:34 -0800 Subject: [PATCH] Wrap log in enabled check --- .../Internal/DefaultHubDispatcher.Log.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.SignalR.Core/Internal/DefaultHubDispatcher.Log.cs b/src/Microsoft.AspNetCore.SignalR.Core/Internal/DefaultHubDispatcher.Log.cs index 096b4ec229..10fb4da955 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/Internal/DefaultHubDispatcher.Log.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/Internal/DefaultHubDispatcher.Log.cs @@ -102,8 +102,11 @@ namespace Microsoft.AspNetCore.SignalR.Internal public static void SendingResult(ILogger logger, string invocationId, ObjectMethodExecutor objectMethodExecutor) { - var resultType = objectMethodExecutor.AsyncResultType == null ? objectMethodExecutor.MethodReturnType : objectMethodExecutor.AsyncResultType; - _sendingResult(logger, invocationId, resultType.FullName, null); + 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)