fix: 修复日志记录函数调用错误
Docker Build and Push / build (push) Has been cancelled

- 将 `logrus.Errorf("Server err: ", err)` 修正为 `logrus.Errorf("Server err: %v", err)`,以正确格式化错误信息。
- 将 `logrus.Infof(startInfo)` 修正为 `logrus.Info(startInfo)`,因为 `startInfo` 已经是格式化的字符串。
- 在多处将 `logrus.Error` 和 `entry.Errorf` 错误用法修正为 `logrus.Errorf` 和 `entry.Error`,确保日志格式化与函数签名匹配。
This commit is contained in:
2026-02-10 21:02:30 +08:00
parent 1e85ad88ff
commit 2ca4ad5437
4 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -71,10 +71,10 @@ func main() {
logrus.WithFields(logrus.Fields{
"prefix": fmt.Sprintf("[PID:%d]", os.Getpid()),
}).Infof(startInfo)
}).Info(startInfo)
err := server.ListenAndServe()
if err != nil {
logrus.Errorf("Server err: ", err)
logrus.Errorf("Server err: %v", err)
}
}