Wrap log in enabled check

This commit is contained in:
BrennanConroy 2018-11-06 09:24:34 -08:00 committed by GitHub
parent b2037efa08
commit 71e2f45450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -102,8 +102,11 @@ namespace Microsoft.AspNetCore.SignalR.Internal
public static void SendingResult(ILogger logger, string invocationId, ObjectMethodExecutor objectMethodExecutor) public static void SendingResult(ILogger logger, string invocationId, ObjectMethodExecutor objectMethodExecutor)
{ {
var resultType = objectMethodExecutor.AsyncResultType == null ? objectMethodExecutor.MethodReturnType : objectMethodExecutor.AsyncResultType; if (logger.IsEnabled(LogLevel.Trace))
_sendingResult(logger, invocationId, resultType.FullName, null); {
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) public static void FailedInvokingHubMethod(ILogger logger, string hubMethod, Exception exception)