From 02655479c5c300d9dc35194c85e60a75ecd0faa8 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Tue, 26 Jul 2022 17:55:47 +0900 Subject: [PATCH] [Tizen.Log] Optimize separator Signed-off-by: Youngjae Cho --- src/Tizen.Log/Tizen/Log.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Tizen.Log/Tizen/Log.cs b/src/Tizen.Log/Tizen/Log.cs index 927513a..dc4de93 100755 --- a/src/Tizen.Log/Tizen/Log.cs +++ b/src/Tizen.Log/Tizen/Log.cs @@ -27,6 +27,7 @@ namespace Tizen /// 3 public class Log { + private static char[] sep = { '\\', '/' }; /// /// Prints a log message with the VERBOSE priority. /// @@ -119,7 +120,7 @@ namespace Tizen } else { - int index = file.LastIndexOfAny(new char[] { '\\', '/' }); + int index = file.LastIndexOfAny(sep); string filename = file.Substring(index + 1); Interop.Dlog.Print(priority, tag, "%s: %s(%d) > %s", filename, func, line, message); } @@ -133,6 +134,7 @@ namespace Tizen [EditorBrowsable(EditorBrowsableState.Never)] public class InternalLog { + private static char[] sep = { '\\', '/' }; /// /// Prints a log message with the VERBOSE priority. /// @@ -226,7 +228,7 @@ namespace Tizen } else { - int index = file.LastIndexOfAny(new char[] { '\\', '/' }); + int index = file.LastIndexOfAny(sep); string filename = file.Substring(index + 1); Interop.Dlog.InternalPrint(log_id, priority, tag, "%s: %s(%d) > %s", filename, func, line, message); } @@ -240,6 +242,7 @@ namespace Tizen [EditorBrowsable(EditorBrowsableState.Never)] public class SecureLog { + private static char[] sep = { '\\', '/' }; /// /// Prints a log message with the VERBOSE priority. /// @@ -334,7 +337,7 @@ namespace Tizen } else { - int index = file.LastIndexOfAny(new char[] { '\\', '/' }); + int index = file.LastIndexOfAny(sep); string filename = file.Substring(index + 1); Interop.Dlog.InternalPrint(log_id, priority, tag, "%s: %s(%d) > %s", filename, func, line, message); } -- 2.7.4