优化日志打印格式

This commit is contained in:
2025-08-21 14:51:48 +08:00
parent f6adc5b2a1
commit 7761fb1343
6 changed files with 26 additions and 25 deletions

2
cap.go
View File

@@ -93,7 +93,7 @@ func startPacketCapture() {
// 创建数据包源,用于从网络接口读取数据包
packetSource := gopacket.NewPacketSource(handle, handle.LinkType())
fmt.Printf("正在监听网络接口 %s, 使用过滤器 '%s'...\n", *InterfaceName, *Protocol)
log.Printf(" 正在监听网络接口 %s, 使用过滤器 '%s'...\n", *InterfaceName, *Protocol)
// 创建信号通道,用于捕获中断信号
sigChan := make(chan os.Signal, 1)