Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Reacting to verbose rename #3701

Merged
merged 1 commit into from
Dec 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static ControllerActionInvokerLoggerExtensions()
"Executing action method {ActionName} with arguments ({Arguments}) - ModelState is {ValidationState}'");

_actionMethodExecuted = LoggerMessage.Define<string, string>(
LogLevel.Verbose,
LogLevel.Debug,
2,
"Executed action method {ActionName}, returned result {ActionResult}.'");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static DefaultActionSelectorLoggerExtensions()
1,
"Request matched multiple actions resulting in ambiguity. Matching actions: {AmbiguousActions}");
_constraintMismatch = LoggerMessage.Define<string, string, IActionConstraint>(
LogLevel.Verbose,
LogLevel.Debug,
2,
"Action '{ActionName}' with id '{ActionId}' did not match the constraint '{ActionConstraint}'");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ static FilterActionInvokerLoggerExtensions()
1,
"Authorization failed for the request at filter '{AuthorizationFilter}'.");
_resourceFilterShortCircuit = LoggerMessage.Define<object>(
LogLevel.Verbose,
LogLevel.Debug,
2,
"Request was short circuited at resource filter '{ResourceFilter}'.");
_actionFilterShortCircuit = LoggerMessage.Define<object>(
LogLevel.Verbose,
LogLevel.Debug,
3,
"Request was short circuited at action filter '{ActionFilter}'.");
_exceptionFilterShortCircuit = LoggerMessage.Define<object>(
LogLevel.Verbose,
LogLevel.Debug,
4,
"Request was short circuited at exception filter '{ExceptionFilter}'.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static class MvcRouteHandlerLoggerExtensions
static MvcRouteHandlerLoggerExtensions()
{
_actionExecuting = LoggerMessage.Define<string>(
LogLevel.Verbose,
LogLevel.Debug,
1,
"Executing action {ActionName}");

Expand Down Expand Up @@ -44,7 +44,7 @@ public static void ExecutedAction(this ILogger logger, ActionDescriptor action,

public static void NoActionsMatched(this ILogger logger)
{
logger.LogVerbose(3, "No actions matched the current request");
logger.LogDebug(3, "No actions matched the current request");
}

private class ActionLogScope : ILogValues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ static ObjectResultExecutorLoggerExtensions()
1,
"Executing ObjectResult, writing value {Value}.");
_formatterSelected = LoggerMessage.Define<IOutputFormatter, string>(
LogLevel.Verbose,
LogLevel.Debug,
2,
"Selected output formatter '{OutputFormatter}' and content type '{ContentType}' to write the response.");
_skippedContentNegotiation = LoggerMessage.Define<string>(
LogLevel.Verbose,
LogLevel.Debug,
3,
"Skipped content negotiation as content type '{ContentType}' is explicitly set for the response.");
_noAcceptForNegotiation = LoggerMessage.Define<string>(
LogLevel.Verbose,
LogLevel.Debug,
4,
"No information found on request to perform content negotiation.");
_noFormatterFromNegotiation = LoggerMessage.Define<IEnumerable<MediaTypeHeaderValue>>(
LogLevel.Verbose,
LogLevel.Debug,
5,
"Could not find an output formatter based on content negotiation. Accepted types were ({AcceptTypes})");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal static class ViewResultExecutorLoggerExtensions
static ViewResultExecutorLoggerExtensions()
{
_viewFound = LoggerMessage.Define<string>(
LogLevel.Verbose,
LogLevel.Debug,
1,
"The view '{ViewName}' was found.");
_viewNotFound = LoggerMessage.Define<string, IEnumerable<string>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal static class JsonInputFormatterLoggerExtensions
static JsonInputFormatterLoggerExtensions()
{
_jsonInputFormatterCrashed = LoggerMessage.Define<string>(
LogLevel.Verbose,
LogLevel.Debug,
1,
"JSON input formatter threw an exception.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal static class ModeMatchResultLoggerExtensions
static ModeMatchResultLoggerExtensions()
{
_skippingProcessing = LoggerMessage.Define<ITagHelper, string>(
LogLevel.Verbose,
LogLevel.Debug,
1,
"Skipping processing for tag helper '{TagHelper}' with id '{TagHelperId}'.");
}
Expand Down Expand Up @@ -63,7 +63,7 @@ public static void TagHelperModeMatchResult<TMode>(
logger.LogWarning(logValues);
}

if (logger.IsEnabled(LogLevel.Verbose) && modeMatchResult.FullMatches.Count == 0)
if (logger.IsEnabled(LogLevel.Debug) && modeMatchResult.FullMatches.Count == 0)
{
_skippingProcessing(logger, tagHelper, uniqueId, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public static class DefaultViewComponentInvokerLoggerExtensions
static DefaultViewComponentInvokerLoggerExtensions()
{
_viewComponentExecuting = LoggerMessage.Define<string>(
LogLevel.Verbose,
LogLevel.Debug,
1,
"Executing view component {ViewComponentName}");

_viewComponentExecuted = LoggerMessage.Define<string, double, string>(
LogLevel.Verbose,
LogLevel.Debug,
2,
"Executed view component {ViewComponentName} in {ElapsedMilliseconds}ms and returned " +
"{ViewComponentResult}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static PartialViewResultExecutorLoggerExtensions()
1,
"Executing PartialViewResult, running view at path {Path}.");
_partialViewFound = LoggerMessage.Define<string>(
LogLevel.Verbose,
LogLevel.Debug,
2,
"The partial view '{PartialViewName}' was found.");
_partialViewNotFound = LoggerMessage.Define<string, IEnumerable<string>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static ViewResultExecutorLoggerExtensions()
1,
"Executing ViewResult, running view at path {Path}.");
_viewFound = LoggerMessage.Define<string>(
LogLevel.Verbose,
LogLevel.Debug,
2,
"The view '{ViewName}' was found.");
_viewNotFound = LoggerMessage.Define<string, IEnumerable<string>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal
public class ModeMatchResultTest
{
[Fact]
public void LogDetails_LogsVerboseWhenNoFullMatchesFound()
public void LogDetails_LogsDebugWhenNoFullMatchesFound()
{
// Arrange
var modeMatchResult = new ModeMatchResult<string>();
var logger = MakeLogger(LogLevel.Verbose);
var logger = MakeLogger(LogLevel.Debug);
var tagHelper = new Mock<ITagHelper>();
var uniqueId = "id";
var viewPath = "Views/Home/Index.cshtml";
Expand All @@ -27,7 +27,7 @@ public void LogDetails_LogsVerboseWhenNoFullMatchesFound()

// Assert
Mock.Get(logger).Verify(l => l.Log(
LogLevel.Verbose,
LogLevel.Debug,
It.IsAny<int>(),
It.IsAny<object>(),
It.IsAny<Exception>(),
Expand All @@ -43,7 +43,7 @@ public void LogDetails_DoesNotLogWhenPartialMatchFoundButNoPartiallyMatchedAttri
ModeMatchAttributes.Create("mode0", new[] { "first-attr" }));
modeMatchResult.PartialMatches.Add(
ModeMatchAttributes.Create("mode1", new[] { "first-attr" }, new[] { "second-attr" }));
var logger = MakeLogger(LogLevel.Verbose);
var logger = MakeLogger(LogLevel.Debug);
var tagHelper = new Mock<ITagHelper>();
var uniqueId = "id";
var viewPath = "Views/Home/Index.cshtml";
Expand All @@ -59,7 +59,7 @@ public void LogDetails_DoesNotLogWhenPartialMatchFoundButNoPartiallyMatchedAttri
It.IsAny<Exception>(),
It.IsAny<Func<object, Exception, string>>()), Times.Never);
Mock.Get(logger).Verify(l => l.Log(
LogLevel.Verbose,
LogLevel.Debug,
It.IsAny<int>(),
It.IsAny<object>(),
It.IsAny<Exception>(),
Expand All @@ -74,7 +74,7 @@ public void LogDetails_LogsWhenPartiallyMatchedAttributesFound()
modeMatchResult.PartialMatches.Add(
ModeMatchAttributes.Create("mode0", new[] { "first-attr" }, new[] { "second-attr" }));
modeMatchResult.PartiallyMatchedAttributes.Add("first-attr");
var logger = MakeLogger(LogLevel.Verbose);
var logger = MakeLogger(LogLevel.Debug);
var tagHelper = new Mock<ITagHelper>();
var uniqueId = "id";
var viewPath = "Views/Home/Index.cshtml";
Expand All @@ -90,7 +90,7 @@ public void LogDetails_LogsWhenPartiallyMatchedAttributesFound()
It.IsAny<Exception>(),
It.IsAny<Func<object, Exception, string>>()), Times.Once);
Mock.Get(logger).Verify(l => l.Log(
LogLevel.Verbose,
LogLevel.Debug,
It.IsAny<int>(),
It.IsAny<object>(),
It.IsAny<Exception>(),
Expand Down Expand Up @@ -121,7 +121,7 @@ public void LogDetails_DoesNotLogWhenLoggingLevelIsSetAboveWarning()
It.IsAny<Exception>(),
It.IsAny<Func<object, Exception, string>>()), Times.Never);
Mock.Get(logger).Verify(l => l.Log(
LogLevel.Verbose,
LogLevel.Debug,
It.IsAny<int>(),
It.IsAny<object>(),
It.IsAny<Exception>(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public async Task LogsWhenARequiredAttributeIsMissing(

var loggerData0 = (ILogValues)logger.Logged[0].State;

Assert.Equal(LogLevel.Verbose, logger.Logged[1].LogLevel);
Assert.Equal(LogLevel.Debug, logger.Logged[1].LogLevel);
Assert.IsAssignableFrom<ILogValues>(logger.Logged[1].State);
Assert.StartsWith("Skipping processing for tag helper 'Microsoft.AspNet.Mvc.TagHelpers.ScriptTagHelper'" +
" with id",
Expand Down Expand Up @@ -602,7 +602,7 @@ public async Task LogsWhenAllRequiredAttributesAreMissing()

Assert.Single(logger.Logged);

Assert.Equal(LogLevel.Verbose, logger.Logged[0].LogLevel);
Assert.Equal(LogLevel.Debug, logger.Logged[0].LogLevel);
Assert.IsAssignableFrom<ILogValues>(logger.Logged[0].State);
Assert.StartsWith("Skipping processing for tag helper 'Microsoft.AspNet.Mvc.TagHelpers.ScriptTagHelper'",
((ILogValues)logger.Logged[0].State).ToString());
Expand Down