From b4d88ee6878e4aa398c91e3b9b5c43377403f828 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 6 Mar 2021 23:30:04 +0300 Subject: [PATCH] add logger wrapper stuff Signed-off-by: Vasiliy Tolstov --- go.mod | 2 +- go.sum | 4 ++-- server/http/http_test.go | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ecc2245..cd550a1 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/unistack-org/micro-server-http/v3 v3.2.9 github.com/unistack-org/micro-server-tcp/v3 v3.2.2 github.com/unistack-org/micro-wrapper-trace-opentracing/v3 v3.2.0 - github.com/unistack-org/micro/v3 v3.2.18 + github.com/unistack-org/micro/v3 v3.2.19 google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb google.golang.org/grpc v1.36.0 google.golang.org/protobuf v1.25.1-0.20201208041424-160c7477e0e8 diff --git a/go.sum b/go.sum index d51bab1..59ff0b5 100644 --- a/go.sum +++ b/go.sum @@ -487,8 +487,8 @@ github.com/unistack-org/micro/v3 v3.2.11/go.mod h1:uGPB8BhDWHj63tR3eaoCd3X+lPtAg github.com/unistack-org/micro/v3 v3.2.14/go.mod h1:3j13mSd/rILNjyP0tEVtDxyDkJBtnHUXShNCuPHkC5A= github.com/unistack-org/micro/v3 v3.2.15/go.mod h1:y+fV+BPNK2IqGoLquRU396jTYifG0HCw3zxFfI4E0dc= github.com/unistack-org/micro/v3 v3.2.16/go.mod h1:y+fV+BPNK2IqGoLquRU396jTYifG0HCw3zxFfI4E0dc= -github.com/unistack-org/micro/v3 v3.2.18 h1:+EnZ6xJJzHINQr7c8nkwygkfy+qLssiKd1hktgEzHL4= -github.com/unistack-org/micro/v3 v3.2.18/go.mod h1:y+fV+BPNK2IqGoLquRU396jTYifG0HCw3zxFfI4E0dc= +github.com/unistack-org/micro/v3 v3.2.19 h1:UkiudIMOBD8SS1jnSVUPEfi0CYRVmkm37/2keUkA2p0= +github.com/unistack-org/micro/v3 v3.2.19/go.mod h1:y+fV+BPNK2IqGoLquRU396jTYifG0HCw3zxFfI4E0dc= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA= diff --git a/server/http/http_test.go b/server/http/http_test.go index 6d46a43..f08d7d1 100644 --- a/server/http/http_test.go +++ b/server/http/http_test.go @@ -14,6 +14,8 @@ import ( httpsrv "github.com/unistack-org/micro-server-http/v3" pb "github.com/unistack-org/micro-tests/server/http/proto" "github.com/unistack-org/micro/v3/client" + "github.com/unistack-org/micro/v3/logger" + lwrapper "github.com/unistack-org/micro/v3/logger/wrapper" "github.com/unistack-org/micro/v3/metadata" "github.com/unistack-org/micro/v3/register" "github.com/unistack-org/micro/v3/server" @@ -79,6 +81,7 @@ func TestNativeClientServer(t *testing.T) { server.Name("helloworld"), server.Register(reg), server.Codec("application/json", jsonpbcodec.NewCodec()), + server.WrapHandler(lwrapper.NewServerHandlerWrapper(lwrapper.WithEnabled(true), lwrapper.WithLevel(logger.InfoLevel))), httpsrv.Middleware(mwf), //server.WrapHandler(NewServerHandlerWrapper()), )