Fix sample codes for notification_set/get_led
[platform/core/api/notification.git] / include / notification_debug.h
1 /*
2  * Copyright (c) 2000 - 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 #ifndef __NOTIFICATION_DEBUG_H__
18 #define __NOTIFICATION_DEBUG_H__
19
20 #define LOG_TAG "NOTIFICATION"
21 #include <dlog.h>
22
23 #ifndef EXPORT_API
24 #define EXPORT_API __attribute__ ((visibility("default")))
25 #endif
26
27 #ifndef _DLOG_H_
28 #include <stdio.h>
29
30 #define NOTIFICATION_DBG(fmt , args...) \
31         do { \
32                 printf("[D][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
33         } while (0)
34
35 #define NOTIFICATION_INFO(fmt , args...) \
36         do { \
37                 printf("[I][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
38         } while (0)
39
40 #define NOTIFICATION_WARN(fmt , args...) \
41         do { \
42                 printf("[W][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
43         } while (0)
44
45 #define NOTIFICATION_ERR(fmt , args...) \
46         do { \
47                 printf("[E][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
48         } while (0)
49
50 #else /* _DLOG_H_ */
51
52 #define NOTIFICATION_DBG(fmt , args...) \
53         do { \
54                 SECURE_LOGD("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
55         } while (0)
56
57 #define NOTIFICATION_INFO(fmt , args...) \
58         do { \
59                 SECURE_LOGI("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
60         } while (0)
61
62 #define NOTIFICATION_WARN(fmt , args...) \
63         do { \
64                 SECURE_LOGW("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
65         } while (0)
66
67 #define NOTIFICATION_ERR(fmt , args...) \
68         do { \
69                 SECURE_LOGE("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \
70         } while (0)
71
72 #endif /* _DLOG_H_ */
73
74 #endif /* __NOTIFICATION_DEBUG_H__ */
75