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_LOG_H__
18 #define __TT_DAEMON_LOG_H__
31 TTD_LOG_TYPE_DLOG = 0,
36 int ttd_log_print(ttd_log_level_e level, const char *tag, const char *fmt, ...);
37 int ttd_log_init(ttd_log_type_e type);
38 void ttd_log_fini(void);
46 #define _V(fmt, arg...) ttd_log_print(TTD_LOG_VERBOSE, LOG_TAG, "[%s : %d] " fmt "\n", __func__, __LINE__, ##arg)
50 #define _D(fmt, arg...) ttd_log_print(TTD_LOG_DEBUG, LOG_TAG, "[%s : %d] " fmt "\n", __func__, __LINE__, ##arg)
54 #define _I(fmt, arg...) ttd_log_print(TTD_LOG_INFO, LOG_TAG, "[%s : %d] " fmt "\n", __func__, __LINE__, ##arg)
58 #define _W(fmt, arg...) ttd_log_print(TTD_LOG_WARNING, LOG_TAG, "[%s : %d] " fmt "\n", __func__, __LINE__, ##arg)
62 #define _E(fmt, arg...) ttd_log_print(TTD_LOG_ERROR, LOG_TAG, "[%s : %d] " fmt "\n", __func__, __LINE__, ##arg)
65 #define retvm_if(expr, val, fmt, arg...) do { \
68 _E("(%s) -> %s() return", #expr, __func__); \
73 #define retv_if(expr, val) do { \
75 _E("(%s) -> %s() return", #expr, __func__); \
80 #define retm_if(expr, fmt, arg...) do { \
83 _E("(%s) -> %s() return", #expr, __func__); \
88 #define ret_if(expr) do { \
90 _E("(%s) -> %s() return", #expr, __func__); \
95 #define goto_if(expr, val) do { \
97 _E("(%s) -> goto", #expr); \
102 #define break_if(expr) { \
104 _E("(%s) -> break", #expr); \
109 #define continue_if(expr) { \
111 _E("(%s) -> continue", #expr); \
116 #endif /* __TT_DAEMON_LOG_H__ */