Jeremy Kerr | 3d36ee2 | 2019-05-30 11:15:37 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ |
Jeremy Kerr | 4cdc200 | 2019-02-07 16:49:12 +0800 | [diff] [blame] | 2 | |
| 3 | #ifndef _LIBMCTP_LOG_H |
| 4 | #define _LIBMCTP_LOG_H |
| 5 | |
| 6 | /* libmctp-internal logging */ |
Jeremy Kerr | 4cdc200 | 2019-02-07 16:49:12 +0800 | [diff] [blame] | 7 | |
Jeremy Kerr | c7e764a | 2019-05-28 16:49:03 +0800 | [diff] [blame] | 8 | void mctp_prlog(int level, const char *fmt, ...) |
Jeremy Kerr | 5134f0e | 2019-03-06 09:10:43 +0800 | [diff] [blame] | 9 | __attribute__((format(printf, 2, 3))); |
Jeremy Kerr | 4cdc200 | 2019-02-07 16:49:12 +0800 | [diff] [blame] | 10 | |
Jeremy Kerr | 4cdc200 | 2019-02-07 16:49:12 +0800 | [diff] [blame] | 11 | #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 */ |