35 lines
665 B
C#
35 lines
665 B
C#
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}");
|
|
}
|
|
}
|
|
} |