cmd: print HTTP requests when -debug is enabled

This commit is contained in:
Simon Ser 2020-02-25 15:14:55 +01:00
parent 02faf6174b
commit 3cfd0b942b
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -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)