mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Delete this
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user