xref: /dpdk/lib/stack/stack_pvt.h (revision 99a2dd955fba6e4cc23b77d590a033650ced9c45)
1*99a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
2*99a2dd95SBruce Richardson  * Copyright(c) 2019 Intel Corporation
3*99a2dd95SBruce Richardson  */
4*99a2dd95SBruce Richardson 
5*99a2dd95SBruce Richardson #ifndef _STACK_PVT_H_
6*99a2dd95SBruce Richardson #define _STACK_PVT_H_
7*99a2dd95SBruce Richardson 
8*99a2dd95SBruce Richardson #ifdef __cplusplus
9*99a2dd95SBruce Richardson extern "C" {
10*99a2dd95SBruce Richardson #endif
11*99a2dd95SBruce Richardson 
12*99a2dd95SBruce Richardson #include <rte_log.h>
13*99a2dd95SBruce Richardson 
14*99a2dd95SBruce Richardson extern int stack_logtype;
15*99a2dd95SBruce Richardson 
16*99a2dd95SBruce Richardson #define STACK_LOG(level, fmt, args...) \
17*99a2dd95SBruce Richardson 	rte_log(RTE_LOG_ ##level, stack_logtype, "%s(): "fmt "\n", \
18*99a2dd95SBruce Richardson 		__func__, ##args)
19*99a2dd95SBruce Richardson 
20*99a2dd95SBruce Richardson #define STACK_LOG_ERR(fmt, args...) \
21*99a2dd95SBruce Richardson 	STACK_LOG(ERR, fmt, ## args)
22*99a2dd95SBruce Richardson 
23*99a2dd95SBruce Richardson #define STACK_LOG_WARN(fmt, args...) \
24*99a2dd95SBruce Richardson 	STACK_LOG(WARNING, fmt, ## args)
25*99a2dd95SBruce Richardson 
26*99a2dd95SBruce Richardson #define STACK_LOG_INFO(fmt, args...) \
27*99a2dd95SBruce Richardson 	STACK_LOG(INFO, fmt, ## args)
28*99a2dd95SBruce Richardson 
29*99a2dd95SBruce Richardson 
30*99a2dd95SBruce Richardson #ifdef __cplusplus
31*99a2dd95SBruce Richardson }
32*99a2dd95SBruce Richardson #endif
33*99a2dd95SBruce Richardson 
34*99a2dd95SBruce Richardson #endif /* _STACK_PVT_H_ */
35