优化日志

This commit is contained in:
duanhf2012
2024-09-20 15:17:44 +08:00
parent e6c09064bf
commit 1cf071a444
5 changed files with 8 additions and 12 deletions

View File

@@ -90,7 +90,7 @@ func (gm *GinModule) StartTLS(certFile, keyFile string) {
func (gm *GinModule) Stop(ctx context.Context) {
if err := gm.srv.Shutdown(ctx); err != nil {
log.SError("Server Shutdown", slog.Any("error", err))
log.Error("Server Shutdown", slog.Any("error", err))
}
}

View File

@@ -44,7 +44,7 @@ func Logger() gin.HandlerFunc {
// 响应状态码
statusCode := c.Writer.Status()
log.SDebug(fmt.Sprintf(
log.Debug(fmt.Sprintf(
"%s | %3d | %s %10s | \033[44;37m%-6s\033[0m %s %s | %10v | \"%s\" \"%s\"",
colorForStatus(statusCode),
statusCode,