slog-gin icon indicating copy to clipboard operation
slog-gin copied to clipboard

Allow parsing of latency in desired unit

Open manish-baghel opened this issue 8 months ago • 1 comments

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

manish-baghel avatar Jun 16 '24 12:06 manish-baghel