tizen_2.0_build
[apps/home/starter.git] / lock-mgr / include / lockd-debug.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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 __LOCKD_DEBUG_H__
18 #define __LOCKD_DEBUG_H__
19
20 #include <stdio.h>
21 #include <dlog.h>
22
23 #ifdef  LOG_TAG
24 #undef  LOG_TAG
25 #endif
26
27 #define LOG_TAG "starter"
28
29 #define ENABLE_LOG_SYSTEM
30
31 void lockd_log_t(char *fmt, ...);
32
33 #ifdef ENABLE_LOG_SYSTEM
34 #define STARTER_ERR(fmt, arg...)  LOGE("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##arg)
35 #define STARTER_DBG(fmt, arg...)  LOGD("["LOG_TAG"%s:%d:D] "fmt, __FILE__, __LINE__, ##arg)
36 #else
37 #define STARTER_ERR(fmt, arg...)
38 #define STARTER_DBG(fmt, arg...)
39 #endif
40
41 #ifdef ENABLE_LOG_SYSTEM
42 #define _ERR(fmt, arg...) do { STARTER_ERR(fmt, ##arg); lockd_log_t("["LOG_TAG":%d:E] "fmt, __LINE__, ##arg); } while (0)
43 #define _DBG(fmt, arg...) do { STARTER_DBG(fmt, ##arg); lockd_log_t("["LOG_TAG":%d:D] "fmt, __LINE__, ##arg); } while (0)
44
45 #define LOCKD_ERR(fmt, arg...) _ERR(fmt, ##arg)
46 #define LOCKD_DBG(fmt, arg...) _DBG(fmt, ##arg)
47 #else
48 #define _ERR(...)
49 #define _DBG(...)
50
51 #define LOCKD_ERR(...)
52 #define LOCKD_ERR(...)
53 #endif
54
55 #ifndef TRUE
56 #define TRUE 1
57 #endif
58 #ifndef FALSE
59 #define FALSE 0
60 #endif
61
62 #endif                          /* __LOCKD_DEBUG_H__ */