Initialize Tizen 2.3
[platform/core/appfw/badge.git] / include / badge_log.h
1 /*
2  *  libbadge
3  *
4  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Youngjoo Park <yjoo93.park@samsung.com>,
7  *      Seungtaek Chung <seungtaek.chung@samsung.com>, Youngsub Ko <ys4610.ko@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the License);
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an AS IS BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23
24 #ifndef __BADGE_LOG_DEF_H__
25 #define __BADGE_LOG_DEF_H__
26
27 #ifdef BADGE_USE_DLOG
28
29 #include <dlog.h>
30 #ifdef LOG_TAG
31 #undef LOG_TAG
32 #endif
33 #define LOG_TAG "BADGE"
34
35 #define DBG(fmt , args...) \
36         do { \
37                 SECURE_LOGD("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
38         } while (0)
39
40 #define INFO(fmt , args...) \
41         do { \
42                 SECURE_LOGI("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
43         } while (0)
44
45 #define WARN(fmt , args...) \
46         do { \
47                 SECURE_LOGW("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
48         } while (0)
49
50 #define ERR(fmt , args...) \
51         do { \
52                 SECURE_LOGE("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
53         } while (0)
54
55 #else /* BADGE_USE_DLOG */
56
57 #include <stdio.h>
58
59 #define DBG(fmt , args...) \
60         do { \
61                 printf("[D][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
62         } while (0)
63
64 #define INFO(fmt , args...) \
65         do { \
66                 printf("[I][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
67         } while (0)
68
69 #define WARN(fmt , args...) \
70         do { \
71                 printf("[W][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
72         } while (0)
73
74 #define ERR(fmt , args...) \
75         do { \
76                 printf("[E][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
77         } while (0)
78
79 #endif /* BADGE_USE_DLOG */
80
81 #endif /* __BADGE_LOG_DEF_H__ */