2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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.
17 #ifndef __TT_DAEMON_SYS_INFO_LOG_H__
18 #define __TT_DAEMON_SYS_INFO_LOG_H__
25 #define LOG_TAG "TS_LIB"
28 #define _V(fmt, arg...) log_print(DLOG_VERBOSE, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
32 #define _D(fmt, arg...) log_print(DLOG_DEBUG, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
36 #define _I(fmt, arg...) log_print(DLOG_INFO, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
40 #define _W(fmt, arg...) log_print(DLOG_WARN, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
44 #define _E(fmt, arg...) log_print(DLOG_ERROR, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
47 #define retvm_if(expr, val, fmt, arg...) do { \
50 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
55 #define retv_if(expr, val) do { \
57 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
62 #define retm_if(expr, fmt, arg...) do { \
65 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
70 #define ret_if(expr) do { \
72 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
77 #define goto_if(expr, val) do { \
79 _E("(%s) -> goto", #expr); \
84 #define break_if(expr) { \
86 _E("(%s) -> break", #expr); \
91 #define continue_if(expr) { \
93 _E("(%s) -> continue", #expr); \
104 int log_print(log_priority prio, const char *tag, const char *fmt, ...);
105 int log_type_set(log_type type);
106 void log_file_close(void);
108 #endif /* __TT_DAEMON_SYS_INFO_LOG_H__ */