Closed gaby closed 2 months ago
This can be avoided using:
type NOOPLogger struct{}
func (NOOPLogger) Printf(ctx context.Context, format string, v ...interface{}) {
// Do nothing here
}
But it adds overhead to the RequestCtx for no reason. Anything we can do about this ? @erikdubbelboer
Changing this would in theory break backwards compatibility. It's such a minor thing and your NOOPLogger
is a good solution that I think we should just leave it as is.
Looking at the
Init()
code fromRequestCtx
ifnil
is passes it defaults to using golangs native logger which adds latency.Here https://github.com/valyala/fasthttp/blob/master/server.go#L2720
Is this something that could be removed or avoided?
Related to https://github.com/gofiber/fiber/issues/3130