Supercell.GUT/Supercell.GUT.Server/Debugging/ServerDebuggerListener.cs

41 lines
953 B
C#
Raw Permalink Normal View History

using Microsoft.Extensions.Logging;
using Supercell.GUT.Titan.Logic.Debug;
namespace Supercell.GUT.Server.Debugging;
internal class ServerDebuggerListener : IDebuggerListener
{
private readonly ILogger _logger;
private readonly ILogger _hudPrintLogger;
public ServerDebuggerListener(ILoggerFactory loggerFactory)
{
_logger = loggerFactory.CreateLogger("Logic");
_hudPrintLogger = loggerFactory.CreateLogger("HudPrint");
}
public void OnError(string log)
{
_logger.LogError("{debuggerMessage}", log);
}
public void OnHudPrint(string log)
{
_hudPrintLogger.LogInformation("{debuggerMessage}", log);
}
public void OnPrint(string log)
{
_logger.LogInformation("{debuggerMessage}", log);
}
public void OnWarning(string log)
{
_logger.LogWarning("{debuggerMessage}", log);
}
public void Detach()
{
// Detach.
}
}