2024-03-04 13:19:32 +00:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2024-03-05 10:37:18 +00:00
|
|
|
|
using Supercell.GUT.Titan.Logic.Debug;
|
2024-03-04 13:19:32 +00:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
}
|
|
|
|
|
}
|