1 /******************************************************************************
3 * Copyright (c) 2020 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 *******************************************************************************/
23 * @author Intel Corporation
26 #ifndef _SAMPLEAPP__DEBUG_H_
27 #define _SAMPLEAPP__DEBUG_H_
33 #define MAX_FILE_NAME_LEN (512)
34 #define MAX_PATH_NAME_LEN (1024)
37 #define log_dbg(fmt, ...) \
39 "DEBUG: %s(%d): " fmt "\n", \
41 __LINE__, ##__VA_ARGS__)
43 #define log_dbg(fmt, ...)
46 #if defined(_DEBUG) || defined(_VERBOSE)
47 #define log_wrn(fmt, ...) \
50 "WARNING: %s(%d): " fmt "\n", \
52 __LINE__, ##__VA_ARGS__)
54 #define log_dbg(fmt, ...)
55 #define log_wrn(fmt, ...)
59 #define log_err(fmt, ...) \
61 "ERROR: %s(%d): " fmt "\n", \
63 __LINE__, ##__VA_ARGS__)
66 inline void ShowData(void* ptr, unsigned int size)
68 uint8_t *d = (uint8_t *)ptr;
71 for(i = 0; i < size; i++)
75 printf("%02x ", d[i]);
81 #endif /* _SAMPLEAPP__DEBUG_H_ */