X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=ugapp-wifidirect%2Finclude%2Fwfd-ugapp-util.h;h=434f3a5c82f02f22f9c02f660f28173d324fb784;hb=b29aef1e4e9b50a31e775e22b08601f0212fa6ce;hp=f07d6c10e428beb2fc32e7c4df452bdee79138e8;hpb=2c84dc621ee5bd4d6a67ee10cb61b2256b44a236;p=apps%2Fnative%2Fug-wifi-direct.git diff --git a/ugapp-wifidirect/include/wfd-ugapp-util.h b/ugapp-wifidirect/include/wfd-ugapp-util.h index f07d6c1..434f3a5 100755 --- a/ugapp-wifidirect/include/wfd-ugapp-util.h +++ b/ugapp-wifidirect/include/wfd-ugapp-util.h @@ -1,13 +1,13 @@ /* * WiFi-Direct UG * -* Copyright 2012 Samsung Electronics Co., Ltd +* Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (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.tizenopensource.org/license +* http://floralicense.org/license * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -25,52 +25,46 @@ * @version 0.1 */ - #ifndef __WFD_APP_UTIL_H__ #define __WFD_APP_UTIL_H__ - #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" -#ifdef VITA_FEATURE +#ifdef USE_DLOG #include -#define WIFI_DIRECT_APP_MID "wfd-ugapp" - -#define WFD_APP_LOG_LOW LOG_VERBOSE -#define WFD_APP_LOG_HIGH LOG_INFO -#define WFD_APP_LOG_ERROR LOG_ERROR -#define WFD_APP_LOG_WARN LOG_WARN -#define WFD_APP_LOG_ASSERT LOG_FATAL -#define WFD_APP_LOG_EXCEPTION LOG_FATAL -#define WFD_MAX_SIZE 128 -#define WFD_MAC_ADDRESS_SIZE 18 - -char *wfd_app_trim_path(const char *filewithpath); -int wfd_app_gettid(); - -#define WFD_APP_LOG(log_level, format, args...) \ - LOG(log_level, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] " format, wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), ##args) -#define __WFD_APP_FUNC_ENTER__ LOG(LOG_VERBOSE, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] Enter: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__) -#define __WFD_APP_FUNC_EXIT__ LOG(LOG_VERBOSE, WIFI_DIRECT_APP_MID, "[%s:%04d,%d] Quit: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__) - -#else /** _DLOG_UTIL */ - -#define WFD_APP_LOG(log_level, format, args...) printf("[%s:%04d,%d] " format, wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), ##args) -#define __WFD_APP_FUNC_ENTER__ printf("[%s:%04d,%d] Entering: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__) -#define __WFD_APP_FUNC_EXIT__ printf("[%s:%04d,%d] Quit: %s()\n", wfd_app_trim_path(__FILE__), __LINE__, wfd_app_gettid(), __func__) - -#endif /** _USE_DLOG_UTIL */ +#undef LOG_TAG +#define LOG_TAG "WIFI_DIRECT_UGAPP" +#define WDUA_LOGV(format, args...) LOGV(format, ##args) +#define WDUA_LOGD(format, args...) LOGD(format, ##args) +#define WDUA_LOGI(format, args...) LOGI(format, ##args) +#define WDUA_LOGW(format, args...) LOGW(format, ##args) +#define WDUA_LOGE(format, args...) LOGE(format, ##args) +#define WDUA_LOGF(format, args...) LOGF(format, ##args) +#define __WDUA_LOG_FUNC_ENTER__ LOGV("Enter") +#define __WDUA_LOG_FUNC_EXIT__ LOGV("Quit") -#define assertm_if(expr, fmt, arg...) do { \ +#define assertm_if(expr, fmt, args...) do { \ if (expr) { \ - WFD_APP_LOG(WFD_APP_LOG_ASSERT, " ##(%s) -> %s() assert!!## "fmt, #expr, __FUNCTION__, ##arg); \ - exit(1); \ + WDUA_LOGF(" ##(%s) -> assert!!## "fmt, #expr, ##args); \ + exit(1); \ } \ } while (0) +#else /** _DLOG_UTIL */ +#define WDUA_LOGV(format, args...) +#define WDUA_LOGD(format, args...) +#define WDUA_LOGI(format, args...) +#define WDUA_LOGW(format, args...) +#define WDUA_LOGE(format, args...) +#define WDUA_LOGF(format, args...) + +#define __WDUA_LOG_FUNC_ENTER__ +#define __WDUA_LOG_FUNC_EXIT__ + +#endif /** _DLOG_UTIL */ #endif /* __WFD_APP_UTIL_H__ */