removed wrong contacts, added authors
[platform/core/location/lbs-location.git] / location / include / location-log.h
1 /*
2  * libslp-location
3  *
4  * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __LOCATION_LOG_H__
20 #define __LOCATION_LOG_H__
21
22 /**
23  * @file location-log.h
24  * @brief This file contains macro functions for logging.
25  */
26
27 /* Tag defines */
28 #define TAG_LOCATION_FWK "LOCATION"
29
30 #include <dlog.h>
31 #ifdef LOG_TAG
32 #undef LOG_TAG
33 #define LOG_TAG TAG_LOCATION_FWK
34 #endif
35
36 #define LOCATION_LOGD(fmt, args...)             LOGD(fmt, ##args)
37 #define LOCATION_LOGW(fmt, args...)             LOGW(fmt, ##args)
38 #define LOCATION_LOGI(fmt, args...)             LOGI(fmt, ##args)
39 #define LOCATION_LOGE(fmt, args...)             LOGE(fmt, ##args)
40 #define LOCATION_SECLOG(fmt, args...)   SECURE_LOGD(fmt, ##args)
41
42 #define _D(fmt, args...)                LOGD(fmt, ##args)
43 #define _W(fmt, args...)                LOGW(fmt, ##args)
44 #define _I(fmt, args...)                LOGI(fmt, ##args)
45 #define _E(fmt, args...)                LOGE(fmt, ##args)
46
47 #define LOC_IF_FAIL(ret, tag, fmt, arg...) \
48         do { if (ret != 0) { tag(fmt, ##arg); return ret; } } while (0)
49
50 #define LOC_IF_FAIL_LOG(ret, tag, fmt, arg...) \
51         do { if (ret != 0) tag(fmt, ##arg); } while (0)
52
53 #define LOC_COND_RET(cond, ret, tag, fmt, arg...) \
54         do { if (cond) { tag(fmt, ##arg); return ret; } } while (0)
55
56 #define LOC_COND_VOID(cond, tag, fmt, arg...) \
57         do { if (cond) { tag(fmt, ##arg); return ; } } while (0)
58
59 #define LOC_COND_LOG(cond, tag, fmt, arg...) \
60         do { if (cond) tag(fmt, ##arg); } while (0)
61
62 #define LOC_FUNC_LOG            LOGI("%s", __func__);
63
64 #endif