Add logging functionality to GamePresenter and implement GodotLogger

This commit is contained in:
2025-10-29 01:50:55 +01:00
parent 626f81cd85
commit d046130f17
3 changed files with 57 additions and 15 deletions

View File

@@ -0,0 +1,35 @@
using System;
using GameCore.Logging.Interfaces;
using Godot;
namespace CryptonymThunder.Code.Services;
public class GodotLogger : ILogger
{
public void Debug(string message)
{
GD.Print($"[DEBUG] {message}");
}
public void Info(string message)
{
GD.Print($"[INFO] {message}");
}
public void Warn(string message)
{
GD.PushWarning(message);
}
public void Error(string message, Exception ex = null)
{
if (ex != null)
{
GD.PrintErr($"[ERROR] {message} Exception: {ex}");
}
else
{
GD.PrintErr($"[ERROR] {message}");
}
}
}

View File

@@ -0,0 +1 @@
uid://bu65qwpq5f8ba