From 3235990584e6b314a61c370c7350a07bf9082381 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Mon, 11 Apr 2016 16:03:54 -0700 Subject: [PATCH] improve gin logging --- drone.go | 2 ++ router/router.go | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drone.go b/drone.go index 71f39ec2..fe517f61 100644 --- a/drone.go +++ b/drone.go @@ -33,6 +33,8 @@ func main() { // debug level if requested by user if *debug { logrus.SetLevel(logrus.DebugLevel) + } else { + logrus.SetLevel(logrus.WarnLevel) } // Load the configuration from env file diff --git a/router/router.go b/router/router.go index 6d313646..b44ccb32 100644 --- a/router/router.go +++ b/router/router.go @@ -17,7 +17,9 @@ import ( ) func Load(middleware ...gin.HandlerFunc) http.Handler { - e := gin.Default() + e := gin.New() + e.Use(gin.Recovery()) + e.SetHTMLTemplate(template.Load()) e.StaticFS("/static", static.FileSystem())