Skip to content

Commit

Permalink
debug logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjoerd Riemersma committed Sep 8, 2021
1 parent 47c5425 commit ca572b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gin/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gin
import (
"context"
"net/http"
"os"

krakendcors "github.com/devopsfaith/krakend-cors"
"github.com/devopsfaith/krakend-cors/mux"
Expand Down Expand Up @@ -58,6 +59,9 @@ func NewRunServer(next RunServer) RunServer {
// incoming request
func NewRunServerWithLogger(next RunServer, l logging.Logger) RunServer {
return func(ctx context.Context, cfg config.ServiceConfig, handler http.Handler) error {

l, _ := logging.NewLogger("DEBUG", os.Stdout, "")

corsMw := mux.NewWithLogger(cfg.ExtraConfig, l)
if corsMw == nil {
return next(ctx, cfg, handler)
Expand Down

0 comments on commit ca572b0

Please sign in to comment.