2 * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __VOLUME_UTIL_LOG_H__
19 #define __VOLUME_UTIL_LOG_H__
25 #define LOG_TAG "VOLUME"
28 #define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
31 #define LOG_V(prio, tag, fmt, arg...) \
33 dlog_print(prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg);\
36 #define _D(format, arg...) LOG_V(DLOG_DEBUG, LOG_TAG, format, ##arg)
37 #define _I(format, arg...) LOG_V(DLOG_INFO, LOG_TAG, format, ##arg)
38 #define _W(format, arg...) LOG_V(DLOG_WARN, LOG_TAG, format, ##arg)
39 #define _E(format, arg...) LOG_V(DLOG_ERROR, LOG_TAG, format, ##arg)
40 #define _F(format, arg...) LOG_V(DLOG_FATAL, LOG_TAG, format, ##arg)
42 #define _SECURE_E(fmt, arg...) SECURE_LOGE("[%s:%d] "fmt, __FUNCTION__, __LINE__, ##arg)
43 #define _SECURE_D(fmt, arg...) SECURE_LOGD("[%s:%d] "fmt, __FUNCTION__, __LINE__, ##arg)
45 #define retvm_if_timer(timer, expr, val, fmt, arg...) do { \
48 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
54 #define retvm_if(expr, val, fmt, arg...) do { \
57 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
62 #define retv_if(expr, val) do { \
64 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
69 #define retm_if(expr, fmt, arg...) do { \
72 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
77 #define ret_if(expr) do { \
79 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
84 #endif /* __VOLUME_UTIL_LOG_H__ */