Fix logger error append logic.

Signed-off-by: zhanluxianshen <zhanluxianshen@163.com>
This commit is contained in:
zhanluxianshen 2024-11-09 06:48:54 +08:00
parent b142091234
commit 3eb533e416
No known key found for this signature in database
GPG Key ID: BEBCFB39E2C75D73

View File

@ -74,7 +74,9 @@ func (l *Logger) Update(filename string, logLevel string, argv []string) {
if argLogFile != nil {
logFiles = append(logFiles, argLogFile)
}
argLogFileError = errors.Join(argLogFileError, err)
if err != nil {
argLogFileError = errors.Join(argLogFileError, err)
}
}
defer func() {
if argLogFileError != nil {