Debug: 增强H3C防火墙接口输出调试
- 输出小于1000字节的完整内容 - 便于诊断防火墙接口解析问题
This commit is contained in:
@@ -36,10 +36,13 @@ func (p *H3CParser) Parse(device *models.Device, outputs []string) error {
|
||||
|
||||
// outputs[2] 是 display interface
|
||||
fmt.Printf("[H3C DEBUG] display interface output length: %d\n", len(outputs[2]))
|
||||
if len(outputs[2]) > 0 && len(outputs[2]) <= 200 {
|
||||
fmt.Printf("[H3C DEBUG] Full output: %q\n", outputs[2])
|
||||
} else if len(outputs[2]) > 200 {
|
||||
fmt.Printf("[H3C DEBUG] First 200 chars: %q\n", outputs[2][:200])
|
||||
if len(outputs[2]) > 0 {
|
||||
// 如果输出小于1000字节,完整输出以便调试
|
||||
if len(outputs[2]) <= 1000 {
|
||||
fmt.Printf("[H3C DEBUG] Complete output:\n%s\n", outputs[2])
|
||||
} else {
|
||||
fmt.Printf("[H3C DEBUG] First 200 chars: %q\n", outputs[2][:200])
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("[H3C DEBUG] display interface output is EMPTY!\n")
|
||||
}
|
||||
|
||||
Verwijs in nieuw issue
Block a user