4 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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.
20 #ifndef _SENSOR_LOG_H_
21 #define _SENSOR_LOG_H_
25 #if !defined(NAME_MAX)
29 #define SENSOR_TYPE_SHIFT 16
32 SF_LOG_PRINT_FILE = 1,
37 enum sf_priority_type {
44 #define MICROSECONDS(tv) ((tv.tv_sec * 1000000ll) + tv.tv_usec)
46 //for new log system - dlog
50 #define LOG_TAG "SENSOR"
55 #define DBG(...) do{} while(0)
67 # define warn_if(expr, fmt, arg...) do { \
69 DBG("(%s) -> " fmt, #expr, ##arg); \
72 # define ret_if(expr) do { \
74 DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
78 # define retv_if(expr, val) do { \
80 DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
84 # define retm_if(expr, fmt, arg...) do { \
87 DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
91 # define retvm_if(expr, val, fmt, arg...) do { \
94 DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
100 # define warn_if(expr, fmt, arg...) do { \
105 # define ret_if(expr) do { \
110 # define retv_if(expr, val) do { \
115 # define retm_if(expr, fmt, arg...) do { \
121 # define retvm_if(expr, val, fmt, arg...) do { \
130 #endif /* _SENSOR_LOG_H_ */