From ef9b03fbf5d339c8a4c3ac49a5f602fced216f06 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Fri, 16 May 2025 22:28:04 +0800 Subject: [PATCH] fix: unable to get net.Interface cause panic (#21277) --- internal/logger/logger.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index a6273a5c4..978f32332 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -75,7 +75,10 @@ var matchingFuncNames = [...]string{ var ( quietFlag, jsonFlag, anonFlag bool // Custom function to format error - errorFmtFunc func(string, error, bool) string + // can be registered by RegisterError + errorFmtFunc = func(introMsg string, err error, jsonFlag bool) string { + return fmt.Sprintf("msg: %s\n err:%s", introMsg, err) + } ) // EnableQuiet - turns quiet option on.