Delete this

This commit is contained in:
Jordan Brown
2020-04-24 15:28:47 -04:00
parent 08c0e55680
commit 6c2e53fc5c
2 changed files with 21 additions and 6 deletions
@@ -336,11 +336,6 @@ namespace Tgstation.Server.Host.Core
if (logger == null)
throw new ArgumentNullException(nameof(logger));
// Log the active configuration.
logger.LogTrace("Active Config:");
foreach (var section in Configuration.GetChildren())
logger.LogTrace("{0}: {1}", section.Key, section.Value);
logger.LogDebug("Content Root: {0}", hostingEnvironment.ContentRootPath);
logger.LogTrace("Web Root: {0}", hostingEnvironment.WebRootPath);
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
@@ -14,11 +15,30 @@ namespace Tgstation.Server.Host.Core
/// Initializes a new instance of the <see cref="ServerPortProivder"/> <see langword="class"/>.
/// </summary>
/// <param name="configuration">The <see cref="IConfiguration"/> to use.</param>
public ServerPortProivder(IConfiguration configuration)
/// <param name="logger">The <see cref="ILogger"/> to use.</param>
public ServerPortProivder(IConfiguration configuration, ILogger<ServerPortProivder> logger)
{
if (configuration == null)
throw new ArgumentNullException(nameof(configuration));
// Log the active configuration.
logger.LogTrace("Active Config:");
void LogSection(IConfigurationSection section, string prefix)
{
prefix = $"{prefix}{section.Key}:";
if (section.Value != null)
logger.LogTrace("{0} {1}", prefix, section.Value);
else
{
foreach (var child in section.GetChildren())
LogSection(child, prefix);
}
}
foreach (var section in configuration.GetChildren())
LogSection(section, String.Empty);
var httpEndpoint = configuration
.GetSection("Kestrel")
.GetSection("EndPoints")