2 * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __NFC_DEBUG_PRIVATE_H__
19 #define __NFC_DEBUG_PRIVATE_H__
27 // below define should define before blog.h
28 #define LOG_TAG "NFC_PLUGIN_EMUL"
32 #define LOG_COLOR_RED "\033[0;31m"
33 #define LOG_COLOR_GREEN "\033[0;32m"
34 #define LOG_COLOR_BROWN "\033[0;33m"
35 #define LOG_COLOR_BLUE "\033[0;34m"
36 #define LOG_COLOR_PURPLE "\033[0;35m"
37 #define LOG_COLOR_CYAN "\033[0;36m"
38 #define LOG_COLOR_LIGHTBLUE "\033[0;37m"
39 #define LOG_COLOR_END "\033[0;m"
42 #define DEBUG_MSG_PRINT_BUFFER(buffer,length) \
45 LOGD(LOG_COLOR_BLUE"BUFFER =>"LOG_COLOR_END);\
46 for(; i < length; i++)\
48 LOGD(LOG_COLOR_BLUE" [0x%x] "LOG_COLOR_END,buffer[i]);\
50 LOGD(LOG_COLOR_BLUE""LOG_COLOR_END);\
53 #define DEBUG_MSG_PRINT_BUFFER_CHAR(buffer,length) \
56 LOGD(LOG_COLOR_BLUE"BUFFER =>"LOG_COLOR_END);\
57 for(; i < length; i++)\
59 LOGD(LOG_COLOR_BLUE" [%c] "LOG_COLOR_END,buffer[i]);\
61 LOGD(LOG_COLOR_BLUE""LOG_COLOR_END);\
64 #define DEBUG_MSG(format,args...) \
66 LOGD(LOG_COLOR_CYAN" "format""LOG_COLOR_END, ##args);\
69 #define DEBUG_ERR_MSG(format,args...) \
71 LOGD(LOG_COLOR_RED" "format""LOG_COLOR_END, ##args);\
74 #define DEBUG_EMUL_BEGIN() \
77 LOGD(LOG_COLOR_CYAN" BEGIN >>>>"LOG_COLOR_END); \
80 #define DEBUG_EMUL_END() \
83 LOGD(LOG_COLOR_CYAN" END >>>>"LOG_COLOR_END); \
87 #define PROFILING(str) \
89 struct timeval mytime;\
90 char buf[128]; = {0};\
91 memset(buf, 0x00, 128);\
92 gettimeofday(&mytime, NULL);\
93 char time_string[128] = {0,};\
94 sprintf(time_string, "%d.%4d", mytime.tv_sec, mytime.tv_usec);\
96 LOGD("\t time = [%s]", time_string);\