1 /******************************************************************************
\r
3 * Copyright (c) 2019 Intel.
\r
5 * Licensed under the Apache License, Version 2.0 (the "License");
\r
6 * you may not use this file except in compliance with the License.
\r
7 * You may obtain a copy of the License at
\r
9 * http://www.apache.org/licenses/LICENSE-2.0
\r
11 * Unless required by applicable law or agreed to in writing, software
\r
12 * distributed under the License is distributed on an "AS IS" BASIS,
\r
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
14 * See the License for the specific language governing permissions and
\r
15 * limitations under the License.
\r
17 *******************************************************************************/
\r
23 * @author Intel Corporation
\r
26 #ifndef _SAMPLEAPP__DEBUG_H_
\r
27 #define _SAMPLEAPP__DEBUG_H_
\r
33 #define MAX_FILE_NAME_LEN (512)
\r
34 #define MAX_PATH_NAME_LEN (1024)
\r
37 #define log_dbg(fmt, ...) \
\r
39 "DEBUG: %s(%d): " fmt "\n", \
\r
41 __LINE__, ##__VA_ARGS__)
\r
43 #define log_dbg(fmt, ...)
\r
46 #if defined(_DEBUG) || defined(_VERBOSE)
\r
47 #define log_wrn(fmt, ...) \
\r
50 "WARNING: %s(%d): " fmt "\n", \
\r
52 __LINE__, ##__VA_ARGS__)
\r
54 #define log_dbg(fmt, ...)
\r
55 #define log_wrn(fmt, ...)
\r
59 #define log_err(fmt, ...) \
\r
61 "ERROR: %s(%d): " fmt "\n", \
\r
63 __LINE__, ##__VA_ARGS__)
\r
66 inline void ShowData(void* ptr, unsigned int size)
\r
68 uint8_t *d = (uint8_t *)ptr;
\r
71 for(i = 0; i < size; i++)
\r
75 printf("%02x ", d[i]);
\r
81 #endif /* _SAMPLEAPP__DEBUG_H_ */
\r