Timothy McDaniel 3789483934 event/dlb: add dynamic logging
This commit adds base support for dynamic logging.
The default log level is NOTICE. Dynamic logging
is used exclusively throughout this patchset.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
2020-11-02 14:46:01 +01:00

26 lines
649 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2016-2020 Intel Corporation
*/
#ifndef _DLB_EVDEV_LOG_H_
#define _DLB_EVDEV_LOG_H_
extern int eventdev_dlb_log_level;
/* Dynamic logging */
#define DLB_LOG_IMPL(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, eventdev_dlb_log_level, "%s" fmt "\n", \
__func__, ##args)
#define DLB_LOG_INFO(fmt, args...) \
DLB_LOG_IMPL(INFO, fmt, ## args)
#define DLB_LOG_ERR(fmt, args...) \
DLB_LOG_IMPL(ERR, fmt, ## args)
/* remove debug logs at compile time unless actually debugging */
#define DLB_LOG_DBG(fmt, args...) \
RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
#endif /* _DLB_EVDEV_LOG_H_ */