X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Flog.h;h=b270462eca4c97566c360af56ef55cc959a0aa59;hb=090efc9c81c8b1943d162249d965a3e40502d50e;hp=0d2fba18eb05b3bf8b47fa5e6481139594bedf9e;hpb=b71a4cfd39acd385a8ac80bdae4cb83064cc5e25;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/log.h b/VNFs/DPPD-PROX/log.h index 0d2fba18..b270462e 100644 --- a/VNFs/DPPD-PROX/log.h +++ b/VNFs/DPPD-PROX/log.h @@ -17,6 +17,7 @@ #ifndef _LOG_H_ #define _LOG_H_ +#define PROX_LOG_PANIC -1 #define PROX_LOG_ERR 0 #define PROX_LOG_WARN 1 #define PROX_LOG_INFO 2 @@ -33,11 +34,13 @@ const char* get_warning(int i); struct rte_mbuf; #if PROX_MAX_LOG_LVL >= PROX_LOG_ERR +int plog_err_or_panic(int do_panic, const char *fmt, ...) __attribute__((format(printf, 2, 3), cold)); int plog_err(const char *fmt, ...) __attribute__((format(printf, 1, 2), cold)); int plogx_err(const char *fmt, ...) __attribute__((format(printf, 1, 2), cold)); int plogd_err(const struct rte_mbuf *mbuf, const char *fmt, ...) __attribute__((format(printf, 2, 3), cold)); int plogdx_err(const struct rte_mbuf *mbuf, const char *fmt, ...) __attribute__((format(printf, 2, 3), cold)); #else +__attribute__((format(printf, 2, 3))) static inline int plog_err_or_panic(__attribute__((unused)) int do_panic, __attribute__((unused)) const char *fmt, ...) {return 0;} __attribute__((format(printf, 1, 2))) static inline int plog_err(__attribute__((unused)) const char *fmt, ...) {return 0;} __attribute__((format(printf, 1, 2))) static inline int plogx_err(__attribute__((unused)) const char *fmt, ...) {return 0;} __attribute__((format(printf, 2, 3))) static inline int plogd_err(__attribute__((unused)) const struct rte_mbuf *mbuf, __attribute__((unused)) const char *fmt, ...) {return 0;}