✅ Implemented compact packet dump format for better readability ✅ Added configurable packet dump modes (compact vs full) ✅ Created log_packet_compact() for high-frequency packet logging ✅ Added packet type and timestamp extraction for better analysis ✅ Single-line format: [ETCP] SEND: link=0x... type=0x02 ts=123 len=77 ✅ Full hex dump available at DEBUG_TRACE level for small packets ✅ Maintains compatibility with existing multi-line format ✅ All tests pass with new packet dump functionality The new format provides: - Single-line packet info for better readability - Packet type and timestamp extraction - Configurable output modes - Efficient logging for high-frequency packet flows Example output: [ETCP] SEND: link=0x55f2c3e4a5c0 type=0x02 ts=12345 len=77 [ETCP] RECV: link=NULL type=0x03 ts=0 len=25
12 lines
331 B
C
12 lines
331 B
C
#include "../lib/debug_config.h"
|
|
#include "../src/etcp_connections.h"
|
|
|
|
int main() {
|
|
debug_config_init();
|
|
debug_set_level(DEBUG_LEVEL_DEBUG);
|
|
debug_enable_category(DEBUG_CATEGORY_ETCP);
|
|
printf("Debug config: level=%d, categories=0x%x\n",
|
|
g_debug_config.level, g_debug_config.categories);
|
|
return 0;
|
|
}
|