|
bmv2
Designing your own switch target with bmv2
|
Go to the source code of this file.
Classes | |
| class | bm::Logger |
Macros | |
| #define | BMLOG_DEBUG(...) bm::Logger::get()->debug(__VA_ARGS__); |
| #define | BMLOG_TRACE(...) bm::Logger::get()->trace(__VA_ARGS__); |
| #define | BMLOG_DEBUG_PKT(pkt, s, ...) |
| #define | BMLOG_TRACE_PKT(pkt, s, ...) |
| #define | BMLOG_TRACE_SI_PKT(pkt, source_info, s, ...) |
Provides logging facilities for bmv2 and targets written using bmv2 We currently used the spdlog as the logging backend so this module is just a wrapper around the spdlog framework.
The preferred way to log messages is using the logging macros:
| #define BMLOG_DEBUG | ( | ... | ) | bm::Logger::get()->debug(__VA_ARGS__); |
Preferred way (because can be disabled at compile time) to log a debug message. Is enabled by preprocessor BM_LOG_DEBUG_ON.
| #define BMLOG_DEBUG_PKT | ( | pkt, | |
| s, | |||
| ... | |||
| ) |
Same as for BMLOG_DEBUG but for messages regarding a specific packet. Will automatically print the packet id and packet context, along with your message.
| #define BMLOG_TRACE | ( | ... | ) | bm::Logger::get()->trace(__VA_ARGS__); |
Preferred way (because can be disabled at compile time) to log a trace message. Is enabled by preprocessor BM_LOG_TRACE_ON.
| #define BMLOG_TRACE_PKT | ( | pkt, | |
| s, | |||
| ... | |||
| ) |
Same as for BMLOG_TRACE but for messages regarding a specific packet. Will automatically print the packet id and packet context, along with your message.
| #define BMLOG_TRACE_SI_PKT | ( | pkt, | |
| source_info, | |||
| s, | |||
| ... | |||
| ) |
Same as BMLOG_TRACE_PKT except it takes a pointer to a SourceInfo object, and if non-NULL, include its data in the output.
1.8.17