2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Contact: Jeonghoon Park <jh1979.park@samsung.com>
6 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 __CAR_APP_LOG_H__
20 #define __CAR_APP_LOG_H__
27 #define LOG_TAG "CAR_APP"
30 #define _D(fmt, arg...) log_print(DLOG_DEBUG, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
34 #define _I(fmt, arg...) log_print(DLOG_INFO, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
38 #define _W(fmt, arg...) log_print(DLOG_WARN, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
42 #define _E(fmt, arg...) log_print(DLOG_ERROR, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
45 #define retvm_if(expr, val, fmt, arg...) do { \
48 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
53 #define retv_if(expr, val) do { \
55 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
60 #define retv_error_message(expr, err, ret) do { \
62 _E("(%s) Error= {%s} -> %s() return", #expr, get_error_message(err), __FUNCTION__); \
67 #define ret_error_message(expr, ret) do { \
69 _E("(%s) Error= {%s} -> %s() return", #expr, get_error_message(ret), __FUNCTION__); \
74 #define retm_if(expr, fmt, arg...) do { \
77 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
82 #define ret_if(expr) do { \
84 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
89 #define goto_if(expr, val) do { \
91 _E("(%s) -> goto", #expr); \
96 #define break_if(expr) { \
98 _E("(%s) -> break", #expr); \
103 #define continue_if(expr) { \
105 _E("(%s) -> continue", #expr); \
116 int log_print(log_priority prio, const char *tag, const char *fmt, ...);
117 int log_type_set(log_type type);
118 void log_file_close(void);
120 #endif /* __CAR_APP_LOG_H__ */