add missed package config(tapi)
[platform/core/messaging/msg-service.git] / manager / inc / msg-manager-debug.h
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 #ifndef __MSG_MGR_DEBUG_H__
18 #define __MSG_MGR_DEBUG_H__
19
20 /*==================================================================================================
21                                                                                 INCLUDE FILES
22 ==================================================================================================*/
23 #include <sys/types.h>
24 #include <unistd.h>
25 #include <string.h>
26 #include <dlog.h>
27
28 /*==================================================================================================
29                                                                                 DEFINES
30 ==================================================================================================*/
31 #undef LOG_TAG
32 #define LOG_TAG "MSG_MGR"
33
34 /*log macros*/
35 #define MSG_MGR_BEGIN()\
36         do { \
37                 SLOGD(" BEGIN >>>> \n");\
38         } while (0)
39
40 #define MSG_MGR_END()\
41         do { \
42                 SLOGD(" END   <<<<  \n");\
43         } while (0)
44
45 #define MSG_MGR_DEBUG(fmt, ...)\
46         do { \
47                 SLOGD(fmt"\n", ##__VA_ARGS__);\
48         } while (0)
49
50 #define MSG_MGR_INFO(fmt, ...)\
51         do { \
52                 SLOGI("* Info * " fmt "\n", ##__VA_ARGS__);\
53         } while (0)
54
55 #define MSG_MGR_WARN(fmt, ...)\
56         do { \
57                 SLOGW("* Warning * " fmt "\n", ##__VA_ARGS__);\
58         } while (0)
59
60 #define MSG_MGR_ERR(fmt, ...)\
61         do { \
62                 SLOGE("* Error * " fmt "\n", ##__VA_ARGS__);\
63         } while (0)
64
65 #define MSG_MGR_FATAL(fmt, ...)\
66         do { \
67                 SLOGE(" ERROR << " fmt " >>\n", ##__VA_ARGS__);\
68         } while (0)
69
70 /*secure log macros*/
71 #define MSG_MGR_SEC_DEBUG(fmt, ...)\
72         do { \
73                 SECURE_SLOGD(fmt"\n", ##__VA_ARGS__);\
74         } while (0)
75
76 #define MSG_MGR_SEC_INFO(fmt, ...)\
77         do { \
78                 SECURE_SLOGI("* Info * " fmt"\n", ##__VA_ARGS__);\
79         } while (0)
80
81 #define MSG_MGR_SEC_ERR(fmt, ...)\
82         do { \
83                 SECURE_LOG(LOG_ERROR, LOG_TAG, "* Error *" fmt "\n", ##__VA_ARGS__);\
84         } while (0)
85
86
87 #endif /*__MSG_MGR_DEBUG_H__ */
88