3 using System.Runtime.CompilerServices;
\r
8 /// Provides methods to print log messages to Tizen logging system.
\r
13 /// Prints a log message with the DEBUG priority.
\r
15 /// <param name="tag">The tag name of the log message.</param>
\r
16 /// <param name="msg">The log message to print.</param>
\r
17 /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
\r
18 /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
\r
19 /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
\r
20 public static void Debug(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
\r
22 if (String.IsNullOrEmpty(file))
\r
24 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_DEBUG, tag, "%s", msg);
\r
28 Uri f = new Uri(file);
\r
29 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_DEBUG, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
\r
34 /// Prints a log message with the VERBOSE priority.
\r
36 /// <param name="tag">The tag name of the log message.</param>
\r
37 /// <param name="msg">The log message to print.</param>
\r
38 /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
\r
39 /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
\r
40 /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
\r
41 public static void Verbose(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
\r
43 if (String.IsNullOrEmpty(file))
\r
45 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_VERBOSE, tag, "%s", msg);
\r
49 Uri f = new Uri(file);
\r
50 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_VERBOSE, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
\r
55 /// Prints a log message with the INFO priority.
\r
57 /// <param name="tag">The tag name of the log message.</param>
\r
58 /// <param name="msg">The log message to print.</param>
\r
59 /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
\r
60 /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
\r
61 /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
\r
62 public static void Info(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
\r
64 if (String.IsNullOrEmpty(file))
\r
66 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_INFO, tag, "%s", msg);
\r
70 Uri f = new Uri(file);
\r
71 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_INFO, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
\r
76 /// Prints a log message with the WARNING priority.
\r
78 /// <param name="tag">The tag name of the log message.</param>
\r
79 /// <param name="msg">The log message to print.</param>
\r
80 /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
\r
81 /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
\r
82 /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
\r
83 public static void Warn(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
\r
85 if (String.IsNullOrEmpty(file))
\r
87 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_WARN, tag, "%s", msg);
\r
91 Uri f = new Uri(file);
\r
92 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_WARN, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
\r
97 /// Prints a log message with the ERROR priority.
\r
99 /// <param name="tag">The tag name of the log message.</param>
\r
100 /// <param name="msg">The log message to print.</param>
\r
101 /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
\r
102 /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
\r
103 /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
\r
104 public static void Error(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
\r
106 if (String.IsNullOrEmpty(file))
\r
108 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_ERROR, tag, "%s", msg);
\r
112 Uri f = new Uri(file);
\r
113 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_ERROR, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
\r
118 /// Prints a log message with the FATAL priority.
\r
120 /// <param name="tag">The tag name of the log message.</param>
\r
121 /// <param name="msg">The log message to print.</param>
\r
122 /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
\r
123 /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
\r
124 /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
\r
125 public static void Fatal(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
\r
127 if (String.IsNullOrEmpty(file))
\r
129 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_FATAL, tag, "%s", msg);
\r
133 Uri f = new Uri(file);
\r
134 NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_FATAL, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
\r