|
|
|
@ -12,8 +12,6 @@ import ( |
|
|
|
|
|
|
|
|
|
// Server is an server logging middleware.
|
|
|
|
|
func Server(logger log.Logger) middleware.Middleware { |
|
|
|
|
logger = log.With(logger, "trace_id", log.TraceID(), "span_id", log.SpanID()) |
|
|
|
|
|
|
|
|
|
return func(handler middleware.Handler) middleware.Handler { |
|
|
|
|
return func(ctx context.Context, req interface{}) (reply interface{}, err error) { |
|
|
|
|
reply, err = handler(ctx, req) |
|
|
|
@ -32,8 +30,6 @@ func Server(logger log.Logger) middleware.Middleware { |
|
|
|
|
|
|
|
|
|
// Client is an client logging middleware.
|
|
|
|
|
func Client(logger log.Logger) middleware.Middleware { |
|
|
|
|
logger = log.With(logger, "trace_id", log.TraceID(), "span_id", log.SpanID()) |
|
|
|
|
|
|
|
|
|
return func(handler middleware.Handler) middleware.Handler { |
|
|
|
|
return func(ctx context.Context, req interface{}) (reply interface{}, err error) { |
|
|
|
|
reply, err = handler(ctx, req) |
|
|
|
|