Skip to content

Commit

Permalink
cleanup comment and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
anuptalwalkar committed Feb 8, 2017
1 parent c54e318 commit adfce47
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package fx

import (
"context"
gcontext "context"

"github.com/opentracing/opentracing-go"
"github.com/uber/jaeger-client-go"
Expand All @@ -42,12 +41,12 @@ func contextStore(ctx context.Context) ctxStore {
c := ctx.Value(_contextStore)
if c == nil {
c = ctxStore{}
ctx = gcontext.WithValue(ctx, _contextStore, c)
ctx = context.WithValue(ctx, _contextStore, c)
}
return c.(ctxStore)
}

// SetContextStore always returns Context for use in the service
// SetContextStore sets the context with context aware logger
func SetContextStore(ctx context.Context, host service.Host) context.Context {
if host != nil {
ctx = context.WithValue(ctx, _contextStore, ctxStore{
Expand All @@ -71,7 +70,7 @@ func WithContextAwareLogger(ctx context.Context, span opentracing.Span) context.
return context.WithValue(ctx, _contextStore, store)
}

// Logger returns context based logger. If logger is absent from the context,
// Logger returns a context aware logger. If logger is absent from the context store,
// the function updates the context with a new context based logger
func Logger(ctx context.Context) ulog.Log {
store := contextStore(ctx)
Expand Down

0 comments on commit adfce47

Please sign in to comment.