Fix to debuggingutil to display caller information
authorcskim <charles0.kim@samsung.com>
Tue, 28 Mar 2017 05:47:01 +0000 (14:47 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:51 +0000 (18:34 +0900)
Change-Id: Ifc24bcd7579fdf0b94b3ae05d066e57072294f2f

LibTVRefCommonPortable/Utils/DebuggingUtils.cs
LibTVRefCommonPortable/Utils/IDebuggingAPIs.cs
LibTVRefCommonTizen/Ports/DbgPort.cs

index 8ee0563..85c2528 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+using System;
+using System.Runtime.CompilerServices;
 using Xamarin.Forms;
 
 namespace LibTVRefCommonPortable.Utils
@@ -38,11 +40,11 @@ namespace LibTVRefCommonPortable.Utils
         /// This is required for the unit testing of the Calculator application. </summary>
         private class DefaultSM : IDebuggingAPIs
         {
-            public void Dbg(string message)
+            public void Dbg(string message, String file, String func, Int32 line)
             {
             }
 
-            public void Err(string message)
+            public void Err(string message, String file, String func, Int32 line)
             {
             }
 
@@ -68,17 +70,17 @@ namespace LibTVRefCommonPortable.Utils
         /// <summary>
         /// A method displays a debugging message </summary>
         /// <param name="message"> A list of command line arguments.</param>
-        public static void Dbg(string message)
+        public static void Dbg(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
         {
-            ism.Dbg(message);
+            ism.Dbg(message, file, func, line);
         }
 
         /// <summary>
         /// A method displays a error message </summary>
         /// <param name="message"> A list of command line arguments.</param>
-        public static void Err(string message)
+        public static void Err(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
         {
-            ism.Err(message);
+            ism.Err(message, file, func, line);
         }
 
         /// <summary>
index 0b8c138..4c6fc04 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+using System;
+
 namespace LibTVRefCommonPortable.Utils
 {
     /// <summary>
@@ -35,11 +37,11 @@ namespace LibTVRefCommonPortable.Utils
         /// <summary>
         /// A method displays a error log. </summary>
         /// <param name="message"> A error message.</param>
-        void Dbg(string message);
+        void Dbg(string message, String file, String func, Int32 line);
 
         /// <summary>
         /// A method displays a dialog with a given message. </summary>
         /// <param name="message"> A debugging message.</param>
-        void Err(string message);
+        void Err(string message, String file, String func, Int32 line);
     }
 }
index b647b2a..24a10f5 100644 (file)
@@ -17,6 +17,8 @@
 using Xamarin.Forms.Platform.Tizen.Native;
 using Tizen;
 using LibTVRefCommonPortable.Utils;
+using System.Runtime.CompilerServices;
+using System;
 
 namespace LibTVRefCommonTizen.Ports
 {
@@ -51,17 +53,17 @@ namespace LibTVRefCommonTizen.Ports
         /// <summary>
         /// A method displays a debugging log. </summary>
         /// <param name="message"> A debugging message.</param>
-        public void Dbg(string message)
+        public void Dbg(string message, String file, String func, Int32 line)
         {
-            D(message);
+            D(message, file, func, line);
         }
 
         /// <summary>
         /// A method displays a error log. </summary>
         /// <param name="message"> A error message.</param>
-        public void Err(string message)
+        public void Err(string message, String file, String func, Int32 line)
         {
-            E(message);
+            E(message, file, func, line);
         }
 
         /// <summary>
@@ -85,15 +87,15 @@ namespace LibTVRefCommonTizen.Ports
             toast.Show();
         }
 
-        public static void D(string message)
+        public static void D(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
         {
-            Log.Debug(TAG, Prefix + ", " + message);
+            Log.Debug(TAG, Prefix + ", " + message, file, func, line);
 
         }
 
-        public static void E(string message)
+        public static void E(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
         {
-            Log.Error(TAG, Prefix + ", " + message);
+            Log.Error(TAG, Prefix + ", " + message, file, func, line);
         }
 
     }