Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Reacting to verbose rename #157

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
2 changes: 1 addition & 1 deletion samples/SelfHostServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerfactory)
var listener = app.ServerFeatures.Get<WebListener>();
listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.AllowAnonymous;

loggerfactory.AddConsole(LogLevel.Verbose);
loggerfactory.AddConsole(LogLevel.Debug);

app.Run(async context =>
{
Expand Down
9 changes: 4 additions & 5 deletions src/Microsoft.AspNet.Server.WebListener/LogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

using System;
using System.Diagnostics;
using System.Globalization;
using Microsoft.Extensions.Logging;

namespace Microsoft.AspNet.Server.WebListener
Expand Down Expand Up @@ -52,21 +51,21 @@ internal static void LogInfo(ILogger logger, string data)
}
}

internal static void LogVerbose(ILogger logger, string data)
internal static void LogDebug(ILogger logger, string data)
{
if (logger == null)
{
Debug.WriteLine(data);
}
else
{
logger.LogVerbose(data);
logger.LogDebug(data);
}
}

internal static void LogVerbose(ILogger logger, string location, Exception exception)
internal static void LogDebug(ILogger logger, string location, Exception exception)
{
LogVerbose(logger, location + "; " + exception.ToString());
LogDebug(logger, location + "; " + exception.ToString());
}

internal static void LogException(ILogger logger, string location, Exception exception)
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.AspNet.Server.WebListener/MessagePump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private async void ProcessRequestsWorker()
Contract.Assert(_stopping);
if (_stopping)
{
LogHelper.LogVerbose(_logger, "ListenForNextRequestAsync-Stopping", exception);
LogHelper.LogDebug(_logger, "ListenForNextRequestAsync-Stopping", exception);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.Net.Http.Server/LogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ internal static void LogInfo(ILogger logger, string data)
}
}

internal static void LogVerbose(ILogger logger, string data)
internal static void LogDebug(ILogger logger, string data)
{
if (logger == null)
{
Debug.WriteLine(data);
}
else
{
logger.LogVerbose(data);
logger.LogDebug(data);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.Net.Http.Server/RequestProcessing/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ internal unsafe Request(RequestContext httpContext, NativeRequestContext memoryB

// TODO: Verbose log parameters

if (_requestContext.Logger.IsEnabled(LogLevel.Verbose))
if (_requestContext.Logger.IsEnabled(LogLevel.Debug))
{
RequestContext.Logger.LogVerbose(new ReceiveRequestLogContext(this));
RequestContext.Logger.LogDebug(new ReceiveRequestLogContext(this));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.Net.Http.Server/RequestProcessing/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ internal unsafe uint SendHeaders(HttpApi.HTTP_DATA_CHUNK[] dataChunks,
_responseState = ResponseState.StartedSending;
var reasonPhrase = GetReasonPhrase(StatusCode);

if (RequestContext.Logger.IsEnabled(LogLevel.Verbose))
if (RequestContext.Logger.IsEnabled(LogLevel.Debug))
{
RequestContext.Logger.LogVerbose(new SendResponseLogContext(this));
RequestContext.Logger.LogDebug(new SendResponseLogContext(this));
}

/*
Expand Down