Damjan Marion | 38c6191 | 2023-10-17 16:06:26 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 |
| 2 | * Copyright (c) 2023 Cisco Systems, Inc. |
| 3 | */ |
| 4 | |
| 5 | #ifndef _VNET_DEV_LOG_H_ |
| 6 | #define _VNET_DEV_LOG_H_ |
| 7 | |
Damjan Marion | 38c6191 | 2023-10-17 16:06:26 +0000 | [diff] [blame] | 8 | #define log_debug(dev, f, ...) \ |
| 9 | vlib_log (VLIB_LOG_LEVEL_DEBUG, dev_log.class, "%U" f, format_vnet_dev_log, \ |
Damjan Marion | 6bd6c80 | 2023-11-02 18:40:32 +0000 | [diff] [blame] | 10 | dev, clib_string_skip_prefix (__func__, "vnet_dev_"), \ |
| 11 | ##__VA_ARGS__) |
Damjan Marion | 38c6191 | 2023-10-17 16:06:26 +0000 | [diff] [blame] | 12 | #define log_notice(dev, f, ...) \ |
| 13 | vlib_log (VLIB_LOG_LEVEL_NOTICE, dev_log.class, "%U" f, \ |
| 14 | format_vnet_dev_log, dev, 0, ##__VA_ARGS__) |
| 15 | #define log_warn(dev, f, ...) \ |
| 16 | vlib_log (VLIB_LOG_LEVEL_WARNING, dev_log.class, "%U" f, \ |
| 17 | format_vnet_dev_log, dev, 0, ##__VA_ARGS__) |
| 18 | #define log_err(dev, f, ...) \ |
| 19 | vlib_log (VLIB_LOG_LEVEL_ERR, dev_log.class, "%U" f, format_vnet_dev_log, \ |
| 20 | dev, 0, ##__VA_ARGS__) |
| 21 | |
| 22 | #endif /* _VNET_DEV_LOG_H_ */ |