2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Diagnostics;
19 using System.Runtime.CompilerServices;
22 namespace Tizen.Multimedia
24 internal static class MultimediaLog
26 [Conditional("DEBUG")]
27 public static void Debug(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
29 Log.Debug(tag, BuildMessage(message, e), file, func, line);
32 public static void Error(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
34 Log.Error(tag, BuildMessage(message, e), file, func, line);
37 public static void Fatal(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
39 Log.Fatal(tag, BuildMessage(message, e), file, func, line);
42 public static void Info(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
44 Log.Info(tag, BuildMessage(message, e), file, func, line);
47 public static void Verbose(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
49 Log.Verbose(tag, BuildMessage(message, e), file, func, line);
52 public static void Warn(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
54 Log.Warn(tag, BuildMessage(message, e), file, func, line);
57 private static string BuildMessage(string message, Exception exception)
59 if (exception == null)
64 StringBuilder sb = new StringBuilder();
66 Exception e = exception;
69 message += e.Message + Environment.NewLine + e.StackTrace;