package commonctx import ( "context" "github.com/sirupsen/logrus" ) const LoggerKey = "mainLogger" func AddMainLogger(ctx context.Context, logger *logrus.Entry) context.Context { return context.WithValue(ctx, LoggerKey, logger) } func GetLogger(ctx context.Context) *logrus.Entry { return ctx.Value(LoggerKey).(*logrus.Entry) }