/* * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef __PLUGIN_WIFI_LOG_H__ #define __PLUGIN_WIFI_LOG_H__ #include #ifdef __cplusplus extern "C" { #endif //#ifndef UA_EXPORT_API //#define UA_EXPORT_API __attribute__((visibility("default"))) //#endif #ifdef LOG_TAG #undef LOG_TAG #endif #define LOG_TAG "UA_PLUGIN_WIFI" #define LOG_COLOR_RESET "\033[0m" #define LOG_COLOR_RED "\033[31m" #define LOG_COLOR_YELLOW "\033[33m" #define LOG_COLOR_GREEN "\033[32m" #define LOG_COLOR_BLUE "\033[36m" #define LOG_COLOR_PURPLE "\033[35m" #define UA_WIFI_DBG(fmt, args...) \ SLOGD(fmt, ##args) #if 0 #define UA_WIFI_INFO UA_WIFI_DBG #define UA_WIFI_WARN UA_WIFI_DBG #define UA_WIFI_ERR UA_WIFI_DBG #define UA_WIFI_INFO_C UA_WIFI_DBG #else #define UA_WIFI_INFO(fmt, args...) \ SLOGI(fmt, ##args) #define UA_WIFI_WARN(fmt, arg...) \ SLOGI_IF(TRUE, LOG_COLOR_YELLOW" "fmt" "LOG_COLOR_RESET, ##arg) #define UA_WIFI_ERR(fmt, arg...) \ SLOGI_IF(TRUE, LOG_COLOR_RED" "fmt" "LOG_COLOR_RESET, ##arg) #define UA_WIFI_INFO_C(fmt, arg...) \ SLOGI_IF(TRUE, LOG_COLOR_GREEN" "fmt" "LOG_COLOR_RESET, ##arg) #endif #define FUNC_ENTER UA_WIFI_DBG("+") #define FUNC_EXIT UA_WIFI_DBG("-") #define ret_if(expr) \ do { \ if (expr) { \ UA_WIFI_ERR("(%s) return", #expr); \ return; \ } \ } while (0) #define retv_if(expr, val) \ do { \ if (expr) { \ UA_WIFI_ERR("(%s) return", #expr); \ return (val); \ } \ } while (0) #ifdef __cplusplus } #endif #endif /* __UA_PLUGIN_WIFI_LOG_H__ */