1 /******************************************************************************
3 * Copyright (c) 2019 Intel.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 *******************************************************************************/
24 * @author Intel Corporation
27 #ifndef _SAMPLEAPP__DEBUG_H_
28 #define _SAMPLEAPP__DEBUG_H_
34 #define MAX_FILE_NAME_LEN (512)
35 #define MAX_PATH_NAME_LEN (1024)
38 #define log_dbg(fmt, ...) \
40 "DEBUG: %s(%d): " fmt "\n", \
42 __LINE__, ##__VA_ARGS__)
44 #define log_dbg(fmt, ...)
47 #if defined(_DEBUG) || defined(_VERBOSE)
48 #define log_wrn(fmt, ...) \
51 "WARNING: %s(%d): " fmt "\n", \
53 __LINE__, ##__VA_ARGS__)
55 #define log_dbg(fmt, ...)
56 #define log_wrn(fmt, ...)
60 #define log_err(fmt, ...) \
62 "ERROR: %s(%d): " fmt "\n", \
64 __LINE__, ##__VA_ARGS__)
67 inline void ShowData(void* ptr, unsigned int size)
69 uint8_t *d = (uint8_t *)ptr;
72 for(i = 0; i < size; i++)
76 printf("%02x ", d[i]);
82 #endif /* _SAMPLEAPP__DEBUG_H_ */