using Mogafa.Common.Logging; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; namespace Mogafa.Unity.Common.Logging { public class UnityLogger : Mogafa.Common.Logging.LoggerAbstract { protected override void LogCriticalInternal(string tag, string format, params object[] args) { LogErrorInternal(tag, format, args); } protected override void LogDebugInternal(string tag, string format, params object[] args) { var formatWithTag = format; if (!string.IsNullOrEmpty(tag)) { formatWithTag = "[" + tag + "] " + format; } if (args == null || args.Length == 0) { Debug.Log(formatWithTag); return; } Debug.LogFormat(formatWithTag, args); } protected override void LogErrorInternal(string tag, string format, params object[] args) { var formatWithTag = format; if (!string.IsNullOrEmpty(tag)) { formatWithTag = "[" + tag + "] " + format; } if (args == null || args.Length == 0) { Debug.LogError(formatWithTag); return; } Debug.LogErrorFormat(formatWithTag, args); } protected override void LogInformationInternal(string tag, string format, params object[] args) { LogDebugInternal(tag, format, args); } protected override void LogTraceInternal(string tag, string format, params object[] args) { LogDebugInternal(tag, format, args); } protected override void LogWarningInternal(string tag, string format, params object[] args) { var formatWithTag = format; if (!string.IsNullOrEmpty(tag)) { formatWithTag = "[" + tag + "] " + format; } if (args == null || args.Length == 0) { Debug.LogWarning(formatWithTag); return; } Debug.LogWarningFormat(formatWithTag, args); } } }