Initial upload of minicontrol(tagging)
[apps/home/minicontrol.git] / include / minicontrol-log.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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 #ifndef _MINICTRL_LOG_H_
18 #define _MINICTRL_LOG_H_
19
20 #include <stdio.h>
21 #include <string.h>
22
23 #ifdef MINICTRL_USE_DLOG
24 #include <dlog.h>
25
26 #ifdef LOG_TAG
27 #undef LOG_TAG
28 #endif
29
30 #define LOG_TAG "libminicontrol"
31 #define DBG(fmt , args...) \
32         do{ \
33                 LOGD("[%s : %d] "fmt"\n",__func__,__LINE__,##args ); \
34         } while(0)
35
36 #define INFO(fmt , args...) \
37         do{ \
38                 LOGI("[%s : %d] "fmt"\n",__func__,__LINE__,##args ); \
39         } while(0)
40
41 #define WARN(fmt , args...) \
42         do{ \
43                 LOGI("[%s : %d] "fmt"\n",__func__,__LINE__,##args ); \
44         } while(0)
45
46 #define ERR(fmt , args...) \
47         do{ \
48                 LOGI("[%s : %d] "fmt"\n",__func__,__LINE__,##args ); \
49         } while(0)
50
51 #else /* MINICTRL_USE_DLOG */
52 #define DBG(fmt , args...) \
53         do{ \
54                 printf("[D][%s : %d] "fmt"\n", __func__,__LINE__,##args ); \
55         } while(0)
56
57 #define INFO(fmt , args...) \
58         do{ \
59                 printf("[I][%s : %d] "fmt"\n", __func__,__LINE__,##args ); \
60         } while(0)
61
62 #define WARN(fmt , args...) \
63         do{ \
64                 printf("[W][%s : %d] "fmt"\n", __func__,__LINE__,##args ); \
65         } while(0)
66
67 #define ERR(fmt , args...) \
68         do{ \
69                 printf("[E][%s : %d] "fmt"\n", __func__,__LINE__,##args ); \
70         } while(0)
71
72 #endif /* MINICTRL_USE_DLOG */
73
74 #endif /* _MINICTRL_LOG_H_ */
75