From 673854b06067bd8d0d720084f69341d88c701845 Mon Sep 17 00:00:00 2001 From: SonjaKhan Date: Wed, 5 Nov 2014 10:38:18 -0800 Subject: [PATCH] renaming TraceType to LogLevel --- src/Microsoft.AspNet.Routing/Logging/LogFormatter.cs | 2 +- src/Microsoft.AspNet.Routing/Logging/LoggerExtensions.cs | 2 +- src/Microsoft.AspNet.Routing/RouteCollection.cs | 2 +- src/Microsoft.AspNet.Routing/RouteConstraintMatcher.cs | 4 ++-- src/Microsoft.AspNet.Routing/RouterMiddleware.cs | 2 +- src/Microsoft.AspNet.Routing/Template/TemplateRoute.cs | 6 +++--- test/Microsoft.AspNet.Routing.Tests/Logging/NullLogger.cs | 4 ++-- test/Microsoft.AspNet.Routing.Tests/Logging/TestLogger.cs | 6 +++--- test/Microsoft.AspNet.Routing.Tests/Logging/WriteContext.cs | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Microsoft.AspNet.Routing/Logging/LogFormatter.cs b/src/Microsoft.AspNet.Routing/Logging/LogFormatter.cs index 8409c99193..4d74041a36 100644 --- a/src/Microsoft.AspNet.Routing/Logging/LogFormatter.cs +++ b/src/Microsoft.AspNet.Routing/Logging/LogFormatter.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Routing.Logging.Internal { /// /// A formatter for use with . diff --git a/src/Microsoft.AspNet.Routing/Logging/LoggerExtensions.cs b/src/Microsoft.AspNet.Routing/Logging/LoggerExtensions.cs index bb7ffa1426..b0bea0e851 100644 --- a/src/Microsoft.AspNet.Routing/Logging/LoggerExtensions.cs +++ b/src/Microsoft.AspNet.Routing/Logging/LoggerExtensions.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Routing.Logging.Internal public static void WriteValues([NotNull] this ILogger logger, object values) { logger.Write( - eventType: TraceType.Verbose, + logLevel: LogLevel.Verbose, eventId: 0, state: values, exception: null, diff --git a/src/Microsoft.AspNet.Routing/RouteCollection.cs b/src/Microsoft.AspNet.Routing/RouteCollection.cs index d0e34ee99c..06a73cd0b6 100644 --- a/src/Microsoft.AspNet.Routing/RouteCollection.cs +++ b/src/Microsoft.AspNet.Routing/RouteCollection.cs @@ -81,7 +81,7 @@ namespace Microsoft.AspNet.Routing } } - if (_logger.IsEnabled(TraceType.Verbose)) + if (_logger.IsEnabled(LogLevel.Verbose)) { _logger.WriteValues(new RouteCollectionRouteAsyncValues() { diff --git a/src/Microsoft.AspNet.Routing/RouteConstraintMatcher.cs b/src/Microsoft.AspNet.Routing/RouteConstraintMatcher.cs index 01a69566ee..8fb5edcc56 100644 --- a/src/Microsoft.AspNet.Routing/RouteConstraintMatcher.cs +++ b/src/Microsoft.AspNet.Routing/RouteConstraintMatcher.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Routing if (!constraint.Match(httpContext, route, kvp.Key, routeValues, routeDirection)) { if (routeDirection.Equals(RouteDirection.IncomingRequest) - && logger.IsEnabled(TraceType.Verbose)) + && logger.IsEnabled(LogLevel.Verbose)) { logger.WriteValues(new RouteConstraintMatcherMatchValues() { @@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Routing } if (routeDirection.Equals(RouteDirection.IncomingRequest) - && logger.IsEnabled(TraceType.Verbose)) + && logger.IsEnabled(LogLevel.Verbose)) { logger.WriteValues(new RouteConstraintMatcherMatchValues() { diff --git a/src/Microsoft.AspNet.Routing/RouterMiddleware.cs b/src/Microsoft.AspNet.Routing/RouterMiddleware.cs index 2e1a4ace79..e935d998bb 100644 --- a/src/Microsoft.AspNet.Routing/RouterMiddleware.cs +++ b/src/Microsoft.AspNet.Routing/RouterMiddleware.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Builder await _router.RouteAsync(context); - if (_logger.IsEnabled(TraceType.Verbose)) + if (_logger.IsEnabled(LogLevel.Verbose)) { _logger.WriteValues(new RouterMiddlewareInvokeValues() { Handled = context.IsHandled }); } diff --git a/src/Microsoft.AspNet.Routing/Template/TemplateRoute.cs b/src/Microsoft.AspNet.Routing/Template/TemplateRoute.cs index dbfaa9c223..b50aff5b1c 100644 --- a/src/Microsoft.AspNet.Routing/Template/TemplateRoute.cs +++ b/src/Microsoft.AspNet.Routing/Template/TemplateRoute.cs @@ -107,7 +107,7 @@ namespace Microsoft.AspNet.Routing.Template if (values == null) { - if (_logger.IsEnabled(TraceType.Verbose)) + if (_logger.IsEnabled(LogLevel.Verbose)) { _logger.WriteValues(CreateRouteAsyncValues( requestPath, @@ -136,7 +136,7 @@ namespace Microsoft.AspNet.Routing.Template RouteDirection.IncomingRequest, _constraintLogger)) { - if (_logger.IsEnabled(TraceType.Verbose)) + if (_logger.IsEnabled(LogLevel.Verbose)) { _logger.WriteValues(CreateRouteAsyncValues( requestPath, @@ -155,7 +155,7 @@ namespace Microsoft.AspNet.Routing.Template await _target.RouteAsync(context); - if (_logger.IsEnabled(TraceType.Verbose)) + if (_logger.IsEnabled(LogLevel.Verbose)) { _logger.WriteValues(CreateRouteAsyncValues( requestPath, diff --git a/test/Microsoft.AspNet.Routing.Tests/Logging/NullLogger.cs b/test/Microsoft.AspNet.Routing.Tests/Logging/NullLogger.cs index 1049ec0c45..3b2d7ad971 100644 --- a/test/Microsoft.AspNet.Routing.Tests/Logging/NullLogger.cs +++ b/test/Microsoft.AspNet.Routing.Tests/Logging/NullLogger.cs @@ -15,11 +15,11 @@ namespace Microsoft.AspNet.Routing return NullDisposable.Instance; } - public void Write(TraceType eventType, int eventId, object state, Exception exception, Func formatter) + public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) { } - public bool IsEnabled(TraceType eventType) + public bool IsEnabled(LogLevel logLevel) { return false; } diff --git a/test/Microsoft.AspNet.Routing.Tests/Logging/TestLogger.cs b/test/Microsoft.AspNet.Routing.Tests/Logging/TestLogger.cs index c42a3405c5..2b8de04824 100644 --- a/test/Microsoft.AspNet.Routing.Tests/Logging/TestLogger.cs +++ b/test/Microsoft.AspNet.Routing.Tests/Logging/TestLogger.cs @@ -35,11 +35,11 @@ namespace Microsoft.AspNet.Routing return NullDisposable.Instance; } - public void Write(TraceType eventType, int eventId, object state, Exception exception, Func formatter) + public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func formatter) { _sink.Write(new WriteContext() { - EventType = eventType, + LogLevel = logLevel, EventId = eventId, State = state, Exception = exception, @@ -49,7 +49,7 @@ namespace Microsoft.AspNet.Routing }); } - public bool IsEnabled(TraceType eventType) + public bool IsEnabled(LogLevel logLevel) { return _enabled; } diff --git a/test/Microsoft.AspNet.Routing.Tests/Logging/WriteContext.cs b/test/Microsoft.AspNet.Routing.Tests/Logging/WriteContext.cs index 4466b344d3..28f89fe8dc 100644 --- a/test/Microsoft.AspNet.Routing.Tests/Logging/WriteContext.cs +++ b/test/Microsoft.AspNet.Routing.Tests/Logging/WriteContext.cs @@ -8,7 +8,7 @@ namespace Microsoft.AspNet.Routing { public class WriteContext { - public TraceType EventType { get; set; } + public LogLevel LogLevel { get; set; } public int EventId { get; set; }