2025-08-30 09:24:58 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using Unity.VisualScripting;
|
|
|
|
using UnityEngine;
|
|
|
|
|
2025-09-01 10:32:50 +00:00
|
|
|
namespace WZ
|
2025-08-30 09:24:58 +00:00
|
|
|
{
|
|
|
|
public static class LoggerUtils
|
|
|
|
{
|
2025-09-05 11:51:13 +00:00
|
|
|
private static bool _enabled = false;
|
2025-08-30 09:24:58 +00:00
|
|
|
|
|
|
|
public static bool Enabled
|
|
|
|
{
|
|
|
|
get => _enabled;
|
|
|
|
set => _enabled = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Debug(object message, Object context = null)
|
|
|
|
{
|
|
|
|
if (!_enabled) return;
|
2025-09-02 09:14:49 +00:00
|
|
|
Log($"[DEBUG][WZSDK] {message}", context);
|
2025-08-30 09:24:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void Info(object message, Object context = null)
|
|
|
|
{
|
2025-09-25 05:55:15 +00:00
|
|
|
if (!_enabled) return;
|
2025-09-02 09:14:49 +00:00
|
|
|
Log($"[INFO][WZSDK] {message}", context);
|
2025-08-30 09:24:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void Warning(object message, Object context = null)
|
|
|
|
{
|
|
|
|
if (!_enabled) return;
|
2025-09-02 09:14:49 +00:00
|
|
|
Log($"[WARNING][WZSDK] {message}", context);
|
2025-08-30 09:24:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void Error(object message, Object context = null)
|
|
|
|
{
|
2025-09-25 05:55:15 +00:00
|
|
|
if (!_enabled) return;
|
2025-09-02 09:14:49 +00:00
|
|
|
Log($"[ERROR][WZSDK] {message}", context);
|
2025-08-30 09:24:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private static void Log(string message, Object context = null)
|
|
|
|
{
|
|
|
|
if (context != null)
|
|
|
|
{
|
|
|
|
UnityEngine.Debug.Log(message, context);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
UnityEngine.Debug.Log(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|