blob: 758bacf82c4eba25ac3717639a8894bdd8c7e042 [file] [log] [blame]
Jeremy Kerr3d36ee22019-05-30 11:15:37 +08001/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
Jeremy Kerr4cdc2002019-02-07 16:49:12 +08002
3#ifndef _LIBMCTP_LOG_H
4#define _LIBMCTP_LOG_H
5
6/* libmctp-internal logging */
Jeremy Kerr4cdc2002019-02-07 16:49:12 +08007
Jeremy Kerrc7e764a2019-05-28 16:49:03 +08008void mctp_prlog(int level, const char *fmt, ...)
Jeremy Kerr5134f0e2019-03-06 09:10:43 +08009 __attribute__((format(printf, 2, 3)));
Jeremy Kerr4cdc2002019-02-07 16:49:12 +080010
Jeremy Kerr4cdc2002019-02-07 16:49:12 +080011#define mctp_prerr(fmt, ...) mctp_prlog(MCTP_LOG_ERR, fmt, ##__VA_ARGS__)
12#define mctp_prwarn(fmt, ...) mctp_prlog(MCTP_LOG_WARNING, fmt, ##__VA_ARGS__)
13#define mctp_prinfo(fmt, ...) mctp_prlog(MCTP_LOG_INFO, fmt, ##__VA_ARGS__)
14#define mctp_prdebug(fmt, ...) mctp_prlog(MCTP_LOG_DEBUG, fmt, ##__VA_ARGS__)
15
16
17#endif /* _LIBMCTP_LOG_H */