From 1ff79a02e95d70f7baa37526e25ca02d4e89f7f1 Mon Sep 17 00:00:00 2001 From: Eliran Bivas Date: Sat, 23 Dec 2017 14:06:46 +0200 Subject: [PATCH] less logging when using gin (#47) --- server/server.go | 4 +- .../waigani/diffparser/example.diff | 60 +++++++++++++++---- 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/server/server.go b/server/server.go index 8a9df1e..f2da03e 100644 --- a/server/server.go +++ b/server/server.go @@ -28,7 +28,9 @@ func (server *BotServer) initDefaults() { server.Uri = "/" + server.Uri } gin.SetMode(gin.ReleaseMode) - server.engine = gin.Default() + server.engine = gin.New() + server.engine.Use(gin.Recovery()) + server.engine.Use(gin.ErrorLogger()) } func (server *BotServer) registerMetrics() { diff --git a/vendor/github.com/waigani/diffparser/example.diff b/vendor/github.com/waigani/diffparser/example.diff index 5b44f26..2b16d43 100644 --- a/vendor/github.com/waigani/diffparser/example.diff +++ b/vendor/github.com/waigani/diffparser/example.diff @@ -1,11 +1,49 @@ -@@ -0,0 +1,10 @@ -+This is the first line -+This is the second line -+This is the third line -+This is the forth line -+This is the fifth line -+ -+ -+ -+ -+Last line after blanks \ No newline at end of file +diff --git a/file1 b/file1 +index 504d2a1..50ccec3 100644 +--- a/file1 ++++ b/file1 +@@ -1,4 +1,4 @@ ++add a line + some + lines +-in + file1 +diff --git a/file2 b/file2 +deleted file mode 100644 +index c0dafd8..0000000 +--- a/file2 ++++ /dev/null +@@ -1,4 +0,0 @@ +-other +-lines +-in +-file2 +diff --git a/file3 b/file3 +deleted file mode 100644 +index 576bba8..0000000 +--- a/file3 ++++ /dev/null +@@ -1,4 +0,0 @@ +-still +-more +-in +-file3 +\ No newline at end of file +diff --git a/file4 b/file4 +new file mode 100644 +index 0000000..57271b1 +--- /dev/null ++++ b/file4 +@@ -0,0 +1 @@ ++added new file +\ No newline at end of file +diff --git a/newname b/newname +new file mode 100644 +index 0000000..c0dafd8 +--- /dev/null ++++ b/newname +@@ -0,0 +1,4 @@ ++other ++lines ++in ++file2