diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultControllerModelBuilder.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultControllerModelBuilder.cs index 84d798a313..7c4af1010c 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultControllerModelBuilder.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultControllerModelBuilder.cs @@ -34,7 +34,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels IOptions options) { _actionModelBuilder = actionModelBuilder; - _logger = loggerFactory.Create(); + _logger = loggerFactory.CreateLogger(); _authorizationOptions = options?.Options ?? new AuthorizationOptions(); } diff --git a/src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorProvider.cs b/src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorProvider.cs index 686a7b6c13..5a99430f4f 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorProvider.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Mvc.Core _applicationModelBuilder = applicationModelBuilder; _globalFilters = globalFilters.Filters; _conventions = optionsAccessor.Options.Conventions; - _logger = loggerFactory.Create(); + _logger = loggerFactory.CreateLogger(); } public int Order @@ -59,7 +59,7 @@ namespace Microsoft.AspNet.Mvc.Core { foreach (var controller in applicationModel.Controllers) { - _logger.WriteVerbose(new ControllerModelValues(controller)); + _logger.LogVerbose(new ControllerModelValues(controller)); } } return ControllerActionDescriptorBuilder.Build(applicationModel); diff --git a/src/Microsoft.AspNet.Mvc.Core/DefaultActionDescriptorsCollectionProvider.cs b/src/Microsoft.AspNet.Mvc.Core/DefaultActionDescriptorsCollectionProvider.cs index 85f13281e8..9af8aa4a4e 100644 --- a/src/Microsoft.AspNet.Mvc.Core/DefaultActionDescriptorsCollectionProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/DefaultActionDescriptorsCollectionProvider.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Mvc.Core public DefaultActionDescriptorsCollectionProvider(IServiceProvider serviceProvider, ILoggerFactory factory) { _serviceProvider = serviceProvider; - _logger = factory.Create(); + _logger = factory.CreateLogger(); } /// @@ -69,7 +69,7 @@ namespace Microsoft.AspNet.Mvc.Core { foreach (var actionDescriptor in context.Results) { - _logger.WriteVerbose(new ActionDescriptorValues(actionDescriptor)); + _logger.LogVerbose(new ActionDescriptorValues(actionDescriptor)); } } diff --git a/src/Microsoft.AspNet.Mvc.Core/DefaultActionSelector.cs b/src/Microsoft.AspNet.Mvc.Core/DefaultActionSelector.cs index 07a7aa054d..cac43e706e 100644 --- a/src/Microsoft.AspNet.Mvc.Core/DefaultActionSelector.cs +++ b/src/Microsoft.AspNet.Mvc.Core/DefaultActionSelector.cs @@ -31,7 +31,7 @@ namespace Microsoft.AspNet.Mvc.Core _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider; _decisionTreeProvider = decisionTreeProvider; _actionConstraintProviders = actionConstraintProviders.OrderBy(item => item.Order).ToArray(); - _logger = loggerFactory.Create(); + _logger = loggerFactory.CreateLogger(); } public Task SelectAsync([NotNull] RouteContext context) diff --git a/src/Microsoft.AspNet.Mvc.Core/DefaultControllerTypeProvider.cs b/src/Microsoft.AspNet.Mvc.Core/DefaultControllerTypeProvider.cs index 39f0cc0014..d93d7657fd 100644 --- a/src/Microsoft.AspNet.Mvc.Core/DefaultControllerTypeProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/DefaultControllerTypeProvider.cs @@ -33,7 +33,7 @@ namespace Microsoft.AspNet.Mvc ILoggerFactory loggerFactory) { _assemblyProvider = assemblyProvider; - _logger = loggerFactory.Create(); + _logger = loggerFactory.CreateLogger(); } /// @@ -46,7 +46,7 @@ namespace Microsoft.AspNet.Mvc { foreach (var assembly in candidateAssemblies) { - _logger.WriteVerbose(new AssemblyValues(assembly)); + _logger.LogVerbose(new AssemblyValues(assembly)); } } diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/ActionConstraintValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/ActionConstraintValues.cs index 9d514ee6d6..92f603bb72 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/ActionConstraintValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/ActionConstraintValues.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// /// Logging representation of an . /// - public class ActionConstraintValues : LoggerStructureBase + public class ActionConstraintValues : ReflectionBasedLogValues { public ActionConstraintValues(IActionConstraintMetadata inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/ActionDescriptorValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/ActionDescriptorValues.cs index f6323a805b..9b5098f482 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/ActionDescriptorValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/ActionDescriptorValues.cs @@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// Logging representation of the state of an or /// . Logged during action discovery. /// - public class ActionDescriptorValues : LoggerStructureBase + public class ActionDescriptorValues : ReflectionBasedLogValues { public ActionDescriptorValues([NotNull] ActionDescriptor inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/ActionModelValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/ActionModelValues.cs index 74949e39f2..6b89f81126 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/ActionModelValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/ActionModelValues.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// Represents the state of an . /// Logged as a substructure of /// - public class ActionModelValues : LoggerStructureBase + public class ActionModelValues : ReflectionBasedLogValues { // note: omit the controller as this structure is nested inside the ControllerModelValues it belongs to public ActionModelValues(ActionModel inner) diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/ApiExplorerModelValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/ApiExplorerModelValues.cs index 87616de47f..e6431870af 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/ApiExplorerModelValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/ApiExplorerModelValues.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// /// Logging representation of an . /// - public class ApiExplorerModelValues : LoggerStructureBase + public class ApiExplorerModelValues : ReflectionBasedLogValues { public ApiExplorerModelValues(ApiExplorerModel inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/AssemblyValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/AssemblyValues.cs index a0007ff4b4..932b961570 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/AssemblyValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/AssemblyValues.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// /// Logging representation of the state of an . Logged during Assembly discovery in Startup. /// - public class AssemblyValues : LoggerStructureBase + public class AssemblyValues : ReflectionBasedLogValues { public AssemblyValues([NotNull] Assembly inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteInfoValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteInfoValues.cs index 669e0e3958..6f4dbd4ac6 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteInfoValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteInfoValues.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// Logging representation of the state of a . Logged as a substructure of /// . /// - public class AttributeRouteInfoValues : LoggerStructureBase + public class AttributeRouteInfoValues : ReflectionBasedLogValues { public AttributeRouteInfoValues(AttributeRouteInfo inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteModelValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteModelValues.cs index c1af4ddb1a..ebe5bfb6c1 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteModelValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteModelValues.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// Logging representation of the state of a . Logged as a substructure of /// . /// - public class AttributeRouteModelValues : LoggerStructureBase + public class AttributeRouteModelValues : ReflectionBasedLogValues { public AttributeRouteModelValues(AttributeRouteModel inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/ControllerModelValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/ControllerModelValues.cs index 5e5fe749e1..4ecee1c5f0 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/ControllerModelValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/ControllerModelValues.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// /// Logging representation of the state of a . Logged during controller discovery. /// - public class ControllerModelValues : LoggerStructureBase + public class ControllerModelValues : ReflectionBasedLogValues { public ControllerModelValues(ControllerModel inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/FilterDescriptorValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/FilterDescriptorValues.cs index f5c5a7bcdd..fcb33adc8d 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/FilterDescriptorValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/FilterDescriptorValues.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// Logging representation of the state of a . Logged as a substructure of /// . /// - public class FilterDescriptorValues : LoggerStructureBase + public class FilterDescriptorValues : ReflectionBasedLogValues { public FilterDescriptorValues([NotNull] FilterDescriptor inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/FilterValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/FilterValues.cs index 0f8fbc83c1..030d83dac7 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/FilterValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/FilterValues.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// , and as a substructure of /// and . /// - public class FilterValues : LoggerStructureBase + public class FilterValues : ReflectionBasedLogValues { public FilterValues(IFilter inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/LoggerExtensions.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/LoggerExtensions.cs index d64c982a0e..3471bdc78b 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/LoggerExtensions.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/LoggerExtensions.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Logging { public static void WriteValues([NotNull] this ILogger logger, object values) { - logger.Write( + logger.Log( logLevel: LogLevel.Verbose, eventId: 0, state: values, diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/ParameterDescriptorValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/ParameterDescriptorValues.cs index 6357773abe..ffe3866da4 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/ParameterDescriptorValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/ParameterDescriptorValues.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// Logging representation of a . Logged as a substructure of /// . /// - public class ParameterDescriptorValues : LoggerStructureBase + public class ParameterDescriptorValues : ReflectionBasedLogValues { public ParameterDescriptorValues([NotNull] ParameterDescriptor inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/ParameterModelValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/ParameterModelValues.cs index c6ccd37d52..63f52b26e3 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/ParameterModelValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/ParameterModelValues.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// , this contains the name, type, and /// binder metadata of the parameter. /// - public class ParameterModelValues : LoggerStructureBase + public class ParameterModelValues : ReflectionBasedLogValues { public ParameterModelValues([NotNull] ParameterModel inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/RouteConstraintProviderValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/RouteConstraintProviderValues.cs index 861d3906a6..bef31915a4 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/RouteConstraintProviderValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/RouteConstraintProviderValues.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// Logging representation of a . Logged as a substructure of /// /// - public class RouteConstraintProviderValues : LoggerStructureBase + public class RouteConstraintProviderValues : ReflectionBasedLogValues { public RouteConstraintProviderValues([NotNull] IRouteConstraintProvider inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/Logging/RouteDataActionConstraintValues.cs b/src/Microsoft.AspNet.Mvc.Core/Logging/RouteDataActionConstraintValues.cs index ca51a5734a..6ee6dc53c7 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Logging/RouteDataActionConstraintValues.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Logging/RouteDataActionConstraintValues.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc.Logging /// Logging representation of the state of a . Logged as a substructure of /// . /// - public class RouteDataActionConstraintValues : LoggerStructureBase + public class RouteDataActionConstraintValues : ReflectionBasedLogValues { public RouteDataActionConstraintValues([NotNull] RouteDataActionConstraint inner) { diff --git a/src/Microsoft.AspNet.Mvc.Core/MvcRouteHandler.cs b/src/Microsoft.AspNet.Mvc.Core/MvcRouteHandler.cs index 14160cf0c8..e6a944ae5c 100644 --- a/src/Microsoft.AspNet.Mvc.Core/MvcRouteHandler.cs +++ b/src/Microsoft.AspNet.Mvc.Core/MvcRouteHandler.cs @@ -117,7 +117,7 @@ namespace Microsoft.AspNet.Mvc if (_logger == null) { var factory = context.RequestServices.GetRequiredService(); - _logger = factory.Create(); + _logger = factory.CreateLogger(); } } diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs index 795945c6bc..d59ab43742 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs @@ -36,8 +36,8 @@ namespace Microsoft.AspNet.Mvc.Routing _actionDescriptorsCollectionProvider = actionDescriptorsCollectionProvider; _constraintResolver = constraintResolver; - _routeLogger = loggerFactory.Create(); - _constraintLogger = loggerFactory.Create(typeof(RouteConstraintMatcher).FullName); + _routeLogger = loggerFactory.CreateLogger(); + _constraintLogger = loggerFactory.CreateLogger(typeof(RouteConstraintMatcher).FullName); // Force creation of the route to report issues on startup. GetInnerRoute(); diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/ModeMatchResult.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/ModeMatchResult.cs index d7c1735d6c..a8892cbe3b 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/ModeMatchResult.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/ModeMatchResult.cs @@ -55,12 +55,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal attribute => PartiallyMatchedAttributes.Contains( attribute, StringComparer.OrdinalIgnoreCase))); - logger.WriteWarning(new PartialModeMatchLoggerStructure(uniqueId, viewPath, partialOnlyMatches)); + logger.LogWarning(new PartialModeMatchLoggerStructure(uniqueId, viewPath, partialOnlyMatches)); } if (logger.IsEnabled(LogLevel.Verbose) && !FullMatches.Any()) { - logger.WriteVerbose("Skipping processing for {0} {1}", + logger.LogVerbose("Skipping processing for {0} {1}", tagHelper.GetType().GetTypeInfo().FullName, uniqueId); } } diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/PartialAttributeLoggerStructureOfT.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/PartialAttributeLoggerStructureOfT.cs index fd7d0c1075..74c1acaf01 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/PartialAttributeLoggerStructureOfT.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/PartialAttributeLoggerStructureOfT.cs @@ -11,7 +11,7 @@ using Microsoft.Framework.Logging; namespace Microsoft.AspNet.Mvc.TagHelpers.Internal { /// - /// An for log messages regarding instances that opt out of + /// An for log messages regarding instances that opt out of /// processing due to missing attributes for one of several possible modes. /// public class PartialModeMatchLoggerStructure : PartialModeMatchLoggerStructure diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/PartialModeMatchLoggerStructure.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/PartialModeMatchLoggerStructure.cs index f5759e4539..df7f4d166e 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/PartialModeMatchLoggerStructure.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/PartialModeMatchLoggerStructure.cs @@ -8,10 +8,10 @@ using Microsoft.Framework.Logging; namespace Microsoft.AspNet.Mvc.TagHelpers.Internal { /// - /// An for log messages regarding instances that opt out of + /// An for log messages regarding instances that opt out of /// processing due to missing attributes for one of several possible modes. /// - public abstract class PartialModeMatchLoggerStructure : ILoggerStructure + public abstract class PartialModeMatchLoggerStructure : ILogValues { private readonly IEnumerable> _values; diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Logging/NullLogger.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Logging/NullLogger.cs index c1416d132e..3d5c87925e 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Logging/NullLogger.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Logging/NullLogger.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc return NullDisposable.Instance; } - public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) + public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) { } diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Logging/NullLoggerFactory.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Logging/NullLoggerFactory.cs index 31cf88c656..162988f1e1 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Logging/NullLoggerFactory.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Logging/NullLoggerFactory.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Mvc public LogLevel MinimumLevel { get; set; } - public ILogger Create(string name) + public ILogger CreateLogger(string name) { return NullLogger.Instance; } diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Logging/TestLogger.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Logging/TestLogger.cs index da509314e9..b862a53ff6 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Logging/TestLogger.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Logging/TestLogger.cs @@ -33,7 +33,7 @@ namespace Microsoft.AspNet.Mvc return NullDisposable.Instance; } - public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) + public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) { _sink.Write(new WriteContext() { diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Logging/TestLoggerFactory.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Logging/TestLoggerFactory.cs index eaf4d1a644..6a237a9038 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Logging/TestLoggerFactory.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Logging/TestLoggerFactory.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNet.Mvc public LogLevel MinimumLevel { get; set; } - public ILogger Create(string name) + public ILogger CreateLogger(string name) { return new TestLogger(name, _sink); } diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/InnerAttributeRouteTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/InnerAttributeRouteTest.cs index f7bbfb1618..6aba5f0ce2 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/InnerAttributeRouteTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/InnerAttributeRouteTest.cs @@ -1710,8 +1710,8 @@ namespace Microsoft.AspNet.Mvc.Routing new StubRouter(), entries, Enumerable.Empty(), - loggerFactory.Create(), - loggerFactory.Create(typeof(RouteConstraintMatcher).FullName), + loggerFactory.CreateLogger(), + loggerFactory.CreateLogger(typeof(RouteConstraintMatcher).FullName), version: 1); } diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/NullLoggerFactory.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/NullLoggerFactory.cs deleted file mode 100644 index 214769ef65..0000000000 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/NullLoggerFactory.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. 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.Framework.Logging; - -namespace Microsoft.AspNet.Mvc -{ - public class NullLoggerFactory : ILoggerFactory - { - public LogLevel MinimumLevel { get; set; } - - public static NullLoggerFactory Instance = new NullLoggerFactory(); - - public ILogger Create(string name) - { - return NullLogger.Instance; - } - - public void AddProvider(ILoggerProvider provider) - { - - } - } - - public class NullLogger : ILogger - { - public static NullLogger Instance = new NullLogger(); - - public IDisposable BeginScope(object state) - { - return NullDisposable.Instance; - } - - public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) - { - } - - public bool IsEnabled(LogLevel logLevel) - { - return false; - } - } - - public class NullDisposable : IDisposable - { - public static NullDisposable Instance = new NullDisposable(); - - public void Dispose() - { - // intentionally does nothing - } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelperSampleTest.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelperSampleTest.cs index 095ad705d4..7cc39cd022 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelperSampleTest.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/TagHelperSampleTest.cs @@ -69,7 +69,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests } - public ILogger Create(string name) + public ILogger CreateLogger(string name) { return new TestLogger(); } @@ -87,7 +87,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests return new TestDisposable(); } - public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) + public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) { } diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/Internal/ModeMatchResultTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/Internal/ModeMatchResultTest.cs index 0cbb16c5bb..2b972a84a2 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/Internal/ModeMatchResultTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/Internal/ModeMatchResultTest.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal modeMatchResult.LogDetails(logger, tagHelper.Object, uniqueId, viewPath); // Assert - Mock.Get(logger).Verify(l => l.Write( + Mock.Get(logger).Verify(l => l.Log( LogLevel.Verbose, It.IsAny(), It.IsAny(), @@ -51,13 +51,13 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal modeMatchResult.LogDetails(logger, tagHelper.Object, uniqueId, viewPath); // Assert - Mock.Get(logger).Verify(l => l.Write( + Mock.Get(logger).Verify(l => l.Log( LogLevel.Warning, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); - Mock.Get(logger).Verify(l => l.Write( + Mock.Get(logger).Verify(l => l.Log( LogLevel.Verbose, It.IsAny(), It.IsAny(), @@ -82,13 +82,13 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal modeMatchResult.LogDetails(logger, tagHelper.Object, uniqueId, viewPath); // Assert - Mock.Get(logger).Verify(l => l.Write( + Mock.Get(logger).Verify(l => l.Log( LogLevel.Warning, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); - Mock.Get(logger).Verify(l => l.Write( + Mock.Get(logger).Verify(l => l.Log( LogLevel.Verbose, It.IsAny(), It.IsAny(), @@ -113,13 +113,13 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal modeMatchResult.LogDetails(logger, tagHelper.Object, uniqueId, viewPath); // Assert - Mock.Get(logger).Verify(l => l.Write( + Mock.Get(logger).Verify(l => l.Log( LogLevel.Warning, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); - Mock.Get(logger).Verify(l => l.Write( + Mock.Get(logger).Verify(l => l.Log( LogLevel.Verbose, It.IsAny(), It.IsAny(), diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs index 31e6e2dc78..09fb496a73 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/ScriptTagHelperTest.cs @@ -260,9 +260,9 @@ namespace Microsoft.AspNet.Mvc.TagHelpers var loggerData0 = (PartialModeMatchLoggerStructure)logger.Logged[0].State; Assert.Equal(LogLevel.Verbose, logger.Logged[1].LogLevel); - Assert.IsAssignableFrom(logger.Logged[1].State); + Assert.IsAssignableFrom(logger.Logged[1].State); Assert.StartsWith("Skipping processing for Microsoft.AspNet.Mvc.TagHelpers.ScriptTagHelper", - ((ILoggerStructure)logger.Logged[1].State).Format()); + ((ILogValues)logger.Logged[1].State).Format()); } [Fact] @@ -313,9 +313,9 @@ namespace Microsoft.AspNet.Mvc.TagHelpers Assert.Single(logger.Logged); Assert.Equal(LogLevel.Verbose, logger.Logged[0].LogLevel); - Assert.IsAssignableFrom(logger.Logged[0].State); + Assert.IsAssignableFrom(logger.Logged[0].State); Assert.StartsWith("Skipping processing for Microsoft.AspNet.Mvc.TagHelpers.ScriptTagHelper", - ((ILoggerStructure)logger.Logged[0].State).Format()); + ((ILogValues)logger.Logged[0].State).Format()); } [Fact] diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/TagHelperLogger.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/TagHelperLogger.cs index 867b89e00e..a73ad3ed64 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/TagHelperLogger.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/TagHelperLogger.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers return true; } - public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) + public void Log(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) { Logged.Add(new LoggerData(logLevel, state)); } diff --git a/test/WebSites/ModelBindingWebSite/DefaultCalculator.cs b/test/WebSites/ModelBindingWebSite/DefaultCalculator.cs index 61cd6f9a89..88eb389ecb 100644 --- a/test/WebSites/ModelBindingWebSite/DefaultCalculator.cs +++ b/test/WebSites/ModelBindingWebSite/DefaultCalculator.cs @@ -12,7 +12,7 @@ namespace ModelBindingWebSite public DefaultCalculator(ILoggerFactory loggerFactory) { - _logger = loggerFactory.Create(typeof(DefaultCalculator).FullName); + _logger = loggerFactory.CreateLogger(typeof(DefaultCalculator).FullName); } public int Operation(char @operator, int left, int right) @@ -24,7 +24,7 @@ namespace ModelBindingWebSite case '*': return left * right; case '/': return left / right; default: - _logger.WriteError("Unrecognized operator:" + @operator); + _logger.LogError("Unrecognized operator:" + @operator); throw new InvalidOperationException(); } }