add logger wrapper stuff

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-03-06 23:30:04 +03:00
parent 0cde3df915
commit b4d88ee687
3 changed files with 6 additions and 3 deletions

2
go.mod
View File

@ -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

4
go.sum
View File

@ -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=

View File

@ -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()),
)