Apply new BT share UI for tizen 3.0
[apps/native/bluetooth-share-ui.git] / src / applog.h
1 /*
2 * bluetooth-share-ui
3 *
4 * Copyright 2012 Samsung Electronics Co., Ltd
5 *
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 *           GirishAshok Joshi <girish.joshi@samsung.com>
8 *           DoHyun Pyun <dh79.pyun@samsung.com>
9 *
10 * Licensed under the Flora License, Version 1.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.tizenopensource.org/license
15 *
16 * Unless required by applicable law or agreed to in writing,
17 * software distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 */
23
24 #ifndef __APPLOG_H__
25 #define __APPLOG_H__
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /*
32  * ret_if(), retv_if(), retm_if(), retvm_if()
33  *   If expr is true, current function return.
34  *   Postfix 'v' means that it has a return value and
35  *   'm' means that it has output message.
36  *
37  */
38
39 #include <stdio.h>
40 #include <dlog.h>
41
42 #undef LOG_TAG
43 #define LOG_TAG "BLUETOOTH_SHARE_UI"
44
45 #define INFO(fmt, arg...) \
46         SLOGI(fmt, ##arg)
47
48 #define ERR(fmt, arg...) \
49         SLOGE(fmt, ##arg)
50
51 #define DBG(fmt, arg...) \
52         SLOGD(fmt, ##arg)
53
54 #define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args)
55 #define ERR_SECURE(fmt, args...) SECURE_SLOGE(fmt, ##args)
56 #define INFO_SECURE(fmt, args...) SECURE_SLOGI(fmt, ##args)
57
58 #define FN_START DBG("[ENTER FUNC]");
59 #define FN_END DBG("[EXIT FUNC]");
60
61 #define ret_if(expr) do { \
62                 if (expr) { \
63                         return; \
64                 } \
65         } while (0)
66 #define retv_if(expr, val) do { \
67                 if (expr) { \
68                         return (val); \
69                 } \
70         } while (0)
71 #define retm_if(expr, fmt, arg...) do { \
72                 if (expr) { \
73                         ERR(fmt, ##arg); \
74                         return; \
75                 } \
76         } while (0)
77 #define retvm_if(expr, val, fmt, arg...) do { \
78                 if (expr) { \
79                         ERR(fmt, ##arg); \
80                         return (val); \
81                 } \
82         } while (0)
83
84 #ifdef __cplusplus
85 }
86 #endif
87 #endif                          /* __APPLOG_H__ */