// 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.Extensions.Logging; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.Mvc.Logging { internal static class ContentResultLoggerExtensions { private static readonly Action _contentResultExecuting; static ContentResultLoggerExtensions() { _contentResultExecuting = LoggerMessage.Define( LogLevel.Information, 1, "Executing ContentResult with HTTP Response ContentType of {ContentType}"); } public static void ContentResultExecuting(this ILogger logger, MediaTypeHeaderValue contentType) { _contentResultExecuting(logger, contentType?.MediaType, null); } } }