Use adapters logging handler

This commit is contained in:
Lena Fuhrimann 2018-01-06 14:09:06 +01:00
parent 88c5ee3765
commit 70acbd4345
3 changed files with 14 additions and 14 deletions

16
Gopkg.lock generated
View file

@ -25,18 +25,18 @@
revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a" revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a"
version = "v1.1" version = "v1.1"
[[projects]]
name = "github.com/gorilla/handlers"
packages = ["."]
revision = "90663712d74cb411cbef281bc1e08c19d1a76145"
version = "v1.3.0"
[[projects]] [[projects]]
name = "github.com/gorilla/mux" name = "github.com/gorilla/mux"
packages = ["."] packages = ["."]
revision = "7f08801859139f86dfafd1c296e2cba9a80d292e" revision = "7f08801859139f86dfafd1c296e2cba9a80d292e"
version = "v1.6.0" version = "v1.6.0"
[[projects]]
branch = "master"
name = "github.com/mastertinner/adapters"
packages = ["logging"]
revision = "599a2137b7d6f9d3c4e0fbc5cbd932fa78eec137"
[[projects]] [[projects]]
name = "github.com/minio/minio-go" name = "github.com/minio/minio-go"
packages = [".","pkg/credentials","pkg/encrypt","pkg/policy","pkg/s3signer","pkg/s3utils","pkg/set"] packages = [".","pkg/credentials","pkg/encrypt","pkg/policy","pkg/s3signer","pkg/s3utils","pkg/set"]
@ -83,11 +83,11 @@
branch = "master" branch = "master"
name = "golang.org/x/sys" name = "golang.org/x/sys"
packages = ["unix","windows"] packages = ["unix","windows"]
revision = "83801418e1b59fb1880e363299581ee543af32ca" revision = "dd9ec17814d5b1de388ebe438ec013d57d8b3779"
[solve-meta] [solve-meta]
analyzer-name = "dep" analyzer-name = "dep"
analyzer-version = 1 analyzer-version = 1
inputs-digest = "d05a3975fc1101d4255ad3e3388ceaeeff30f95bcc7dcf00f8e3a37fd1cbfb0d" inputs-digest = "f576c4f470078c785c420a021bd30b9383c360ce7821ae39ff99ba7e75c75583"
solver-name = "gps-cdcl" solver-name = "gps-cdcl"
solver-version = 1 solver-version = 1

View file

@ -21,14 +21,14 @@
# version = "2.4.0" # version = "2.4.0"
[[constraint]]
name = "github.com/gorilla/handlers"
version = "1.3.0"
[[constraint]] [[constraint]]
name = "github.com/gorilla/mux" name = "github.com/gorilla/mux"
version = "1.6.0" version = "1.6.0"
[[constraint]]
branch = "master"
name = "github.com/mastertinner/adapters"
[[constraint]] [[constraint]]
name = "github.com/minio/minio-go" name = "github.com/minio/minio-go"
version = "4.0.5" version = "4.0.5"

View file

@ -6,8 +6,8 @@ import (
"net/http" "net/http"
"os" "os"
"github.com/gorilla/handlers"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/mastertinner/adapters/logging"
"github.com/mastertinner/s3manager" "github.com/mastertinner/s3manager"
minio "github.com/minio/minio-go" minio "github.com/minio/minio-go"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -81,5 +81,5 @@ func main() {
Path("/api/buckets/{bucketName}/objects/{objectName}"). Path("/api/buckets/{bucketName}/objects/{objectName}").
Handler(s3manager.DeleteObjectHandler(s3)) Handler(s3manager.DeleteObjectHandler(s3))
log.Fatal(http.ListenAndServe(":"+*port, handlers.LoggingHandler(os.Stdout, r))) log.Fatal(http.ListenAndServe(":"+*port, logging.Handler(os.Stdout)(r)))
} }