4 * Copyright (c) 2010-2013 Samsung Electronics Co., Ltd. All rights reserved.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef __LOCATION_LOG_H__
20 #define __LOCATION_LOG_H__
23 * @file location-log.h
24 * @brief This file contains macro functions for logging.
28 #define TAG_LOCATION_FWK "LOCATION"
33 #define LOG_TAG TAG_LOCATION_FWK
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)
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)
47 #define LOC_IF_FAIL(ret, tag, fmt, arg...) \
48 do { if (ret != 0) { tag(fmt, ##arg); return ret; } } while (0)
50 #define LOC_IF_FAIL_LOG(ret, tag, fmt, arg...) \
51 do { if (ret != 0) tag(fmt, ##arg); } while (0)
53 #define LOC_COND_RET(cond, ret, tag, fmt, arg...) \
54 do { if (cond) { tag(fmt, ##arg); return ret; } } while (0)
56 #define LOC_COND_VOID(cond, tag, fmt, arg...) \
57 do { if (cond) { tag(fmt, ##arg); return ; } } while (0)
59 #define LOC_COND_LOG(cond, tag, fmt, arg...) \
60 do { if (cond) tag(fmt, ##arg); } while (0)
62 #define LOC_FUNC_LOG LOGI("%s", __func__);