49 lines
1.3 KiB (Stored with Git LFS)
C#
49 lines
1.3 KiB (Stored with Git LFS)
C#
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
|
|
namespace Superlazy
|
|
{
|
|
public static class SLLog
|
|
{
|
|
public static ISLLogger Logger
|
|
{
|
|
set
|
|
{
|
|
Loggers ??= new List<ISLLogger>();
|
|
Loggers.Add(value);
|
|
}
|
|
}
|
|
|
|
private static List<ISLLogger> Loggers { get; set; }
|
|
|
|
[Conditional("SLLOG"), Conditional("UNITY_EDITOR")]
|
|
public static void Error(string format, params object[] args)
|
|
{
|
|
if (Loggers == null) return;
|
|
foreach (var logger in Loggers)
|
|
{
|
|
logger.Error(format, args);
|
|
}
|
|
}
|
|
|
|
[Conditional("SLLOG"), Conditional("UNITY_EDITOR")]
|
|
public static void Info(string format, params object[] args)
|
|
{
|
|
if (Loggers == null) return;
|
|
foreach (var logger in Loggers)
|
|
{
|
|
logger.Info(format, args);
|
|
}
|
|
}
|
|
|
|
[Conditional("SLLOG"), Conditional("UNITY_EDITOR")]
|
|
public static void Warn(string format, params object[] args)
|
|
{
|
|
if (Loggers == null) return;
|
|
foreach (var logger in Loggers)
|
|
{
|
|
logger.Warn(format, args);
|
|
}
|
|
}
|
|
}
|
|
} |