WIP request ids + trace context

This commit is contained in:
Christian Schwarz
2020-01-15 17:37:23 +01:00
parent b8d9f4ba92
commit 1bd0dcfca6
16 changed files with 227 additions and 37 deletions
+4
View File
@@ -19,6 +19,10 @@ func WithLogger(ctx context.Context, log Logger) context.Context {
return context.WithValue(ctx, contextKeyLogger, log)
}
func GetLogger(ctx context.Context) Logger {
return getLogger(ctx)
}
func getLogger(ctx context.Context) Logger {
if l, ok := ctx.Value(contextKeyLogger).(Logger); ok {
return l