use zap for logging (#1112)

Use zap for logging
This commit is contained in:
Jon Carl
2019-03-14 21:11:15 +05:30
committed by Vishal
parent 567d1a8c49
commit 45a06cb161
97 changed files with 1999 additions and 1215 deletions
+7 -2
View File
@@ -17,11 +17,13 @@ limitations under the License.
package router
import (
"github.com/gorilla/mux"
"log"
"net/http"
"testing"
"time"
"github.com/gorilla/mux"
"go.uber.org/zap"
)
func OldHandler(responseWriter http.ResponseWriter, request *http.Request) {
@@ -62,7 +64,10 @@ func TestMutableMux(t *testing.T) {
log.Print("Create mutable router")
muxRouter := mux.NewRouter()
muxRouter.HandleFunc("/", OldHandler)
mr := NewMutableRouter(muxRouter)
logger, err := zap.NewDevelopment()
panicIf(err)
mr := NewMutableRouter(logger, muxRouter)
// start http server
log.Print("Start http server")