Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Log / Interop / Interop.Dlog.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System.Runtime.InteropServices;
18
19 internal static partial class Interop
20 {
21     internal static partial class Libraries
22     {
23         public const string Dlog = "libdlog.so.0";
24     }
25
26     internal static partial class Dlog
27     {
28         internal enum LogID : int
29         {
30             LOG_ID_INVALID = -1,
31             LOG_ID_MAIN,
32             LOG_ID_RADIO,
33             LOG_ID_SYSTEM,
34             LOG_ID_APPS,
35             LOG_ID_KMSG,
36             LOG_ID_MAX
37         }
38
39         internal enum LogPriority : int
40         {
41             DLOG_UNKNOWN = 0,
42             DLOG_DEFAULT,
43             DLOG_VERBOSE,
44             DLOG_DEBUG,
45             DLOG_INFO,
46             DLOG_WARN,
47             DLOG_ERROR,
48             DLOG_FATAL,
49             DLOG_SILENT,
50             DLOG_PRIO_MAX,
51         }
52
53         [DllImport(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)]
54         internal static extern int Print(LogPriority prio, string tag, string fmt, string msg);
55
56         [DllImport(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)]
57         internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);
58
59         [DllImport(Libraries.Dlog, EntryPoint = "__dlog_print", CallingConvention = CallingConvention.Cdecl)]
60         internal static extern int InternalPrint(LogID log_id, LogPriority prio, string tag, string fmt, string msg);
61
62         [DllImport(Libraries.Dlog, EntryPoint = "__dlog_print", CallingConvention = CallingConvention.Cdecl)]
63         internal static extern int InternalPrint(LogID log_id, LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);
64
65     }
66 }
67