renaming TraceType to LogLevel
This commit is contained in:
parent
08c591c74b
commit
673854b060
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Routing.Logging.Internal
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A formatter for use with <see cref="Microsoft.Framework.Logging.ILogger.WriteCore(
|
/// A formatter for use with <see cref="Microsoft.Framework.Logging.ILogger.WriteCore(
|
||||||
/// Framework.Logging.TraceType,
|
/// Framework.Logging.LogLevel,
|
||||||
/// int,
|
/// int,
|
||||||
/// object,
|
/// object,
|
||||||
/// Exception, Func{object, Exception, string})"/>.
|
/// Exception, Func{object, Exception, string})"/>.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Routing.Logging.Internal
|
||||||
public static void WriteValues([NotNull] this ILogger logger, object values)
|
public static void WriteValues([NotNull] this ILogger logger, object values)
|
||||||
{
|
{
|
||||||
logger.Write(
|
logger.Write(
|
||||||
eventType: TraceType.Verbose,
|
logLevel: LogLevel.Verbose,
|
||||||
eventId: 0,
|
eventId: 0,
|
||||||
state: values,
|
state: values,
|
||||||
exception: null,
|
exception: null,
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_logger.IsEnabled(TraceType.Verbose))
|
if (_logger.IsEnabled(LogLevel.Verbose))
|
||||||
{
|
{
|
||||||
_logger.WriteValues(new RouteCollectionRouteAsyncValues()
|
_logger.WriteValues(new RouteCollectionRouteAsyncValues()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
if (!constraint.Match(httpContext, route, kvp.Key, routeValues, routeDirection))
|
if (!constraint.Match(httpContext, route, kvp.Key, routeValues, routeDirection))
|
||||||
{
|
{
|
||||||
if (routeDirection.Equals(RouteDirection.IncomingRequest)
|
if (routeDirection.Equals(RouteDirection.IncomingRequest)
|
||||||
&& logger.IsEnabled(TraceType.Verbose))
|
&& logger.IsEnabled(LogLevel.Verbose))
|
||||||
{
|
{
|
||||||
logger.WriteValues(new RouteConstraintMatcherMatchValues()
|
logger.WriteValues(new RouteConstraintMatcherMatchValues()
|
||||||
{
|
{
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
}
|
}
|
||||||
|
|
||||||
if (routeDirection.Equals(RouteDirection.IncomingRequest)
|
if (routeDirection.Equals(RouteDirection.IncomingRequest)
|
||||||
&& logger.IsEnabled(TraceType.Verbose))
|
&& logger.IsEnabled(LogLevel.Verbose))
|
||||||
{
|
{
|
||||||
logger.WriteValues(new RouteConstraintMatcherMatchValues()
|
logger.WriteValues(new RouteConstraintMatcherMatchValues()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Builder
|
||||||
|
|
||||||
await _router.RouteAsync(context);
|
await _router.RouteAsync(context);
|
||||||
|
|
||||||
if (_logger.IsEnabled(TraceType.Verbose))
|
if (_logger.IsEnabled(LogLevel.Verbose))
|
||||||
{
|
{
|
||||||
_logger.WriteValues(new RouterMiddlewareInvokeValues() { Handled = context.IsHandled });
|
_logger.WriteValues(new RouterMiddlewareInvokeValues() { Handled = context.IsHandled });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
|
|
||||||
if (values == null)
|
if (values == null)
|
||||||
{
|
{
|
||||||
if (_logger.IsEnabled(TraceType.Verbose))
|
if (_logger.IsEnabled(LogLevel.Verbose))
|
||||||
{
|
{
|
||||||
_logger.WriteValues(CreateRouteAsyncValues(
|
_logger.WriteValues(CreateRouteAsyncValues(
|
||||||
requestPath,
|
requestPath,
|
||||||
|
|
@ -136,7 +136,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
RouteDirection.IncomingRequest,
|
RouteDirection.IncomingRequest,
|
||||||
_constraintLogger))
|
_constraintLogger))
|
||||||
{
|
{
|
||||||
if (_logger.IsEnabled(TraceType.Verbose))
|
if (_logger.IsEnabled(LogLevel.Verbose))
|
||||||
{
|
{
|
||||||
_logger.WriteValues(CreateRouteAsyncValues(
|
_logger.WriteValues(CreateRouteAsyncValues(
|
||||||
requestPath,
|
requestPath,
|
||||||
|
|
@ -155,7 +155,7 @@ namespace Microsoft.AspNet.Routing.Template
|
||||||
|
|
||||||
await _target.RouteAsync(context);
|
await _target.RouteAsync(context);
|
||||||
|
|
||||||
if (_logger.IsEnabled(TraceType.Verbose))
|
if (_logger.IsEnabled(LogLevel.Verbose))
|
||||||
{
|
{
|
||||||
_logger.WriteValues(CreateRouteAsyncValues(
|
_logger.WriteValues(CreateRouteAsyncValues(
|
||||||
requestPath,
|
requestPath,
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,11 @@ namespace Microsoft.AspNet.Routing
|
||||||
return NullDisposable.Instance;
|
return NullDisposable.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(TraceType eventType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
|
public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsEnabled(TraceType eventType)
|
public bool IsEnabled(LogLevel logLevel)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@ namespace Microsoft.AspNet.Routing
|
||||||
return NullDisposable.Instance;
|
return NullDisposable.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(TraceType eventType, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
|
public void Write(LogLevel logLevel, int eventId, object state, Exception exception, Func<object, Exception, string> formatter)
|
||||||
{
|
{
|
||||||
_sink.Write(new WriteContext()
|
_sink.Write(new WriteContext()
|
||||||
{
|
{
|
||||||
EventType = eventType,
|
LogLevel = logLevel,
|
||||||
EventId = eventId,
|
EventId = eventId,
|
||||||
State = state,
|
State = state,
|
||||||
Exception = exception,
|
Exception = exception,
|
||||||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsEnabled(TraceType eventType)
|
public bool IsEnabled(LogLevel logLevel)
|
||||||
{
|
{
|
||||||
return _enabled;
|
return _enabled;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Microsoft.AspNet.Routing
|
||||||
{
|
{
|
||||||
public class WriteContext
|
public class WriteContext
|
||||||
{
|
{
|
||||||
public TraceType EventType { get; set; }
|
public LogLevel LogLevel { get; set; }
|
||||||
|
|
||||||
public int EventId { get; set; }
|
public int EventId { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue