mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 13:22:09 +08:00
Use the out.Write to write the log content immediately, because the LogFormatter returns a string, the fmt.Fprint is unnecessary here
This commit is contained in:
parent
94153d1e19
commit
8eb474c0ab
@ -6,6 +6,7 @@ package gin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin/internal/bytesconv"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
@ -264,7 +265,7 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
|
||||
|
||||
param.Path = path
|
||||
|
||||
fmt.Fprint(out, formatter(param))
|
||||
out.Write(bytesconv.StringToBytes(formatter(param)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user