Open manish-baghel opened 3 weeks ago
https://github.com/samber/slog-gin/blob/3f56650b1e9cfe502d84e6deb38c501ba3201389/middleware.go#L164
In the above code, I'd like to either override the value or to use an option to parse latency in desired unit for eg. ms. This can be acheived using methods like https://pkg.go.dev/time#Duration.Milliseconds, https://pkg.go.dev/time#Duration.Microseconds, etc.
Or a simpler option for using https://pkg.go.dev/time#Duration.String to return latency in string format
What slog handler do you use?
Can you add a ReplaceAttr formatter?
ReplaceAttr
I'm not against your proposal, but I'm not sure it is in the scope of this library to handle such customization.
https://github.com/samber/slog-gin/blob/3f56650b1e9cfe502d84e6deb38c501ba3201389/middleware.go#L164
In the above code, I'd like to either override the value or to use an option to parse latency in desired unit for eg. ms. This can be acheived using methods like https://pkg.go.dev/time#Duration.Milliseconds, https://pkg.go.dev/time#Duration.Microseconds, etc.
Or a simpler option for using https://pkg.go.dev/time#Duration.String to return latency in string format