From 7868385910b240c6ebe4eb829c1014f820be1599 Mon Sep 17 00:00:00 2001 From: Caleb Ice Date: Fri, 26 Oct 2018 17:12:41 -0700 Subject: [PATCH] Properly updating ctxlogrus package to reflect deprecated state --- logging/logrus/ctxlogrus/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/logging/logrus/ctxlogrus/README.md b/logging/logrus/ctxlogrus/README.md index fc1d0a922..7e7389185 100644 --- a/logging/logrus/ctxlogrus/README.md +++ b/logging/logrus/ctxlogrus/README.md @@ -1,19 +1,19 @@ -# ctx_logrus -`import "github.com/grpc-ecosystem/go-grpc-middleware/tags/logrus"` +# ctxlogrus +`import "github.com/grpc-ecosystem/go-grpc-middleware/logrus/ctxlogrus"` * [Overview](#pkg-overview) * [Imported Packages](#pkg-imports) * [Index](#pkg-index) ## Overview -`ctx_logrus` is a ctxlogger that is backed by logrus +`ctxlogrus` is a ctxlogger that is backed by logrus It accepts a user-configured `logrus.Logger` that will be used for logging. The same `logrus.Logger` will be populated into the `context.Context` passed into gRPC handler code. -You can use `ctx_logrus.Extract` to log into a request-scoped `logrus.Logger` instance in your handler code. +You can use `ctxlogrus.Extract` to log into a request-scoped `logrus.Logger` instance in your handler code. -As `ctx_logrus.Extract` will iterate all tags on from `grpc_ctxtags` it is therefore expensive so it is advised that you +As `ctxlogrus.Extract` will iterate all tags on from `grpc_ctxtags` it is therefore expensive so it is advised that you extract once at the start of the function from the context and reuse it for the remainder of the function (see examples). Please see examples and tests for examples of use. @@ -42,9 +42,9 @@ AddFields adds logrus fields to the logger. ``` go func Extract(ctx context.Context) *logrus.Entry ``` -Extract takes the call-scoped logrus.Entry from ctx_logrus middleware. +Extract takes the call-scoped logrus.Entry from ctxlogrus middleware. -If the ctx_logrus middleware wasn't used, a no-op `logrus.Entry` is returned. This makes it safe to +If the ctxlogrus middleware wasn't used, a no-op `logrus.Entry` is returned. This makes it safe to use regardless. ## func [ToContext](./context.go#L59)