From 3cfd0b942bda7392fd9f26a64251b4b08a9d2a86 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 25 Feb 2020 15:14:55 +0100 Subject: cmd: print HTTP requests when -debug is enabled --- cmd/koushin/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/koushin/main.go b/cmd/koushin/main.go index d260d99..d9edfc9 100644 --- a/cmd/koushin/main.go +++ b/cmd/koushin/main.go @@ -50,6 +50,11 @@ func main() { e.Logger.Fatal(err) } e.Use(middleware.Recover()) + if options.Debug { + e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{ + Format: "${time_rfc3339} method=${method}, uri=${uri}, status=${status}\n", + })) + } if options.Debug { e.Logger.SetLevel(log.DEBUG) -- cgit v1.2.3