2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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 _SENSOR_LOG_H_
19 #define _SENSOR_LOG_H_
23 #if !defined(NAME_MAX)
27 #define SENSOR_TYPE_SHIFT 16
30 SF_LOG_PRINT_FILE = 1,
35 enum sf_priority_type {
42 #define MICROSECONDS(tv) ((tv.tv_sec * 1000000ll) + tv.tv_usec)
44 //for new log system - dlog
48 #define LOG_TAG "SENSOR"
53 #define DBG(...) do{} while(0)
65 # define warn_if(expr, fmt, arg...) do { \
67 DBG("(%s) -> " fmt, #expr, ##arg); \
70 # define ret_if(expr) do { \
72 DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
76 # define retv_if(expr, val) do { \
78 DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
82 # define retm_if(expr, fmt, arg...) do { \
85 DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
89 # define retvm_if(expr, val, fmt, arg...) do { \
92 DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
98 # define warn_if(expr, fmt, arg...) do { \
103 # define ret_if(expr) do { \
108 # define retv_if(expr, val) do { \
113 # define retm_if(expr, fmt, arg...) do { \
119 # define retvm_if(expr, val, fmt, arg...) do { \
128 #endif /* _SENSOR_LOG_H_ */