version update for systemd
[apps/native/starter.git] / 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
18
19 #ifndef __LOCKD_DEBUG_H__
20 #define __LOCKD_DEBUG_H__
21
22 #include <stdio.h>
23 #include <dlog.h>
24
25 #ifdef  LOG_TAG
26 #undef  LOG_TAG
27 #endif
28
29 #define LOG_TAG "starter"
30
31 #define ENABLE_LOG_SYSTEM
32
33 void lockd_log_t(char *fmt, ...);
34
35 #ifdef ENABLE_LOG_SYSTEM
36 #define STARTER_ERR(fmt, arg...)  LOGE("["LOG_TAG"%s:%d:E] "fmt, __FILE__, __LINE__, ##arg)
37 #define STARTER_DBG(fmt, arg...)  LOGD("["LOG_TAG"%s:%d:D] "fmt, __FILE__, __LINE__, ##arg)
38 #else
39 #define STARTER_ERR(fmt, arg...)
40 #define STARTER_DBG(fmt, arg...)
41 #endif
42
43 #ifdef ENABLE_LOG_SYSTEM
44 #define _ERR(fmt, arg...) do { STARTER_ERR(fmt, ##arg); lockd_log_t("["LOG_TAG":%d:E] "fmt, __LINE__, ##arg); } while (0)
45 #define _DBG(fmt, arg...) do { STARTER_DBG(fmt, ##arg); lockd_log_t("["LOG_TAG":%d:D] "fmt, __LINE__, ##arg); } while (0)
46
47 #define LOCKD_ERR(fmt, arg...) _ERR(fmt, ##arg)
48 #define LOCKD_DBG(fmt, arg...) _DBG(fmt, ##arg)
49 #else
50 #define _ERR(...)
51 #define _DBG(...)
52
53 #define LOCKD_ERR(...)
54 #define LOCKD_ERR(...)
55 #endif
56
57 #ifndef TRUE
58 #define TRUE 1
59 #endif
60 #ifndef FALSE
61 #define FALSE 0
62 #endif
63
64 #endif                          /* __LOCKD_DEBUG_H__ */