Modify error code for badge API
[platform/core/appfw/badge.git] / include / badge_log.h
1 /*
2  * Copyright (c) 2000 - 2017 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
18
19 #ifndef __BADGE_LOG_DEF_H__
20 #define __BADGE_LOG_DEF_H__
21
22 #ifdef BADGE_USE_DLOG
23
24 #include <dlog.h>
25 #ifdef LOG_TAG
26 #undef LOG_TAG
27 #endif
28 #define LOG_TAG "BADGE"
29
30 #define DBG(fmt , args...) \
31         do { \
32                 SECURE_LOGD("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
33         } while (0)
34
35 #define INFO(fmt , args...) \
36         do { \
37                 SECURE_LOGI("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
38         } while (0)
39
40 #define WARN(fmt , args...) \
41         do { \
42                 SECURE_LOGW("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
43         } while (0)
44
45 #define ERR(fmt , args...) \
46         do { \
47                 SECURE_LOGE("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
48         } while (0)
49
50 #else /* BADGE_USE_DLOG */
51
52 #include <stdio.h>
53
54 #define DBG(fmt , args...) \
55         do { \
56                 printf("[D][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
57         } while (0)
58
59 #define INFO(fmt , args...) \
60         do { \
61                 printf("[I][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
62         } while (0)
63
64 #define WARN(fmt , args...) \
65         do { \
66                 printf("[W][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
67         } while (0)
68
69 #define ERR(fmt , args...) \
70         do { \
71                 printf("[E][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
72         } while (0)
73
74 #endif /* BADGE_USE_DLOG */
75
76 #endif /* __BADGE_LOG_DEF_H__ */