From c9404c9c7316716285a39c54aa81235394cfca6b Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Thu, 30 Mar 2023 05:34:38 +0800 Subject: [PATCH] fix debug service --- src/Debug/DebugService/UnityDebugService.cs | 26 +++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/Debug/DebugService/UnityDebugService.cs b/src/Debug/DebugService/UnityDebugService.cs index cc992fa..a201af7 100644 --- a/src/Debug/DebugService/UnityDebugService.cs +++ b/src/Debug/DebugService/UnityDebugService.cs @@ -12,19 +12,25 @@ namespace DCFApixels.DragonECS public override void Print(string tag, object v) { - string log = $"[{tag}] {v}"; - string taglower = tag.ToLower(); - if (taglower.Contains("warning")) + string log; + if (!string.IsNullOrEmpty(tag)) { - Debug.LogWarning(log); + log = $"[{tag}] {v}"; + string taglower = tag.ToLower(); + if (taglower.Contains("warning")) + { + Debug.LogWarning(log); + return; + } + if (taglower.Contains("error")) + { + Debug.LogError(log); + return; + } + Debug.Log(log); return; } - if (taglower.Contains("error")) - { - Debug.LogError(log); - return; - } - Debug.Log(log); + Debug.Log(v); } public override void ProfileMarkBegin(int id)