From c1487bf93d49eac2ac131aa91ee0c8c698ef1db3 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Tue, 28 Mar 2017 11:53:35 -0700 Subject: [PATCH] Fix some style nits --- .../Internal/HostingLoggerExtensions.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingLoggerExtensions.cs b/src/Microsoft.AspNetCore.Hosting/Internal/HostingLoggerExtensions.cs index e25f448331..fb31e1ad2b 100644 --- a/src/Microsoft.AspNetCore.Hosting/Internal/HostingLoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.Hosting/Internal/HostingLoggerExtensions.cs @@ -15,11 +15,12 @@ namespace Microsoft.AspNetCore.Hosting.Internal { public static IDisposable RequestScope(this ILogger logger, HttpContext httpContext) { - // to avoid allocation, return a null scope if the logger is not on at least to some degree. + // To avoid allocation, return a null scope if the logger is not on at least to some degree. if (logger.IsEnabled(LogLevel.Critical)) + { return logger.BeginScope(new HostingLogScope(httpContext)); - else - return null; + } + return null; } public static void ApplicationError(this ILogger logger, Exception exception)