mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 05:42: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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/gin-gonic/gin/internal/bytesconv"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@ -264,7 +265,7 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
|
|||||||
|
|
||||||
param.Path = path
|
param.Path = path
|
||||||
|
|
||||||
fmt.Fprint(out, formatter(param))
|
out.Write(bytesconv.StringToBytes(formatter(param)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user