Revise Logger 41/282941/1
authorcheoleun moon <chleun.moon@samsung.com>
Thu, 13 Oct 2022 10:44:09 +0000 (19:44 +0900)
committercheoleun moon <chleun.moon@samsung.com>
Thu, 13 Oct 2022 10:44:13 +0000 (19:44 +0900)
Change-Id: I10bfaabc511f989ad12fc019f32bd0a3cb15df4c

SettingWiFi/SettingWiFi/Logger.cs

index 9b5872246c5599048f46495768f9b964cd290d38..92113eb35debe5b7590a1315e1e9e089d58f5e8c 100644 (file)
@@ -1,3 +1,5 @@
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
 using Tizen;
 
 namespace SettingWiFi
@@ -6,19 +8,24 @@ namespace SettingWiFi
     {
         internal static readonly string LogTag = "SettingWiFi.App";
 
-        internal static void Debug(string msg)
+        internal static void Debug(string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
         {
-            Log.Debug(LogTag, msg);
+            Log.Debug(LogTag, msg, file, func, line);
         }
 
-        internal static void Info(string msg)
+        internal static void Info(string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
         {
-            Log.Info(LogTag, msg);
+            Log.Info(LogTag, msg, file, func, line);
         }
 
-        internal static void Error(string msg)
+        internal static void Error(string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
         {
-            Log.Error(LogTag, msg);
+            Log.Error(LogTag, msg, file, func, line);
+        }
+
+        private static StackFrame GetCaller()
+        {
+            return new System.Diagnostics.StackTrace(1, false).GetFrame(1);
         }
     }
-}
\ No newline at end of file
+}