feat(middleware): Start request_id middleware
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -19,12 +19,12 @@ func GetLogger(ctx context.Context) *logrus.Entry {
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetLoggerWithFields(ctx context.Context, fields logrus.Fields) *logrus.Entry {
|
||||
func GetContextAndLoggerWithFields(ctx context.Context, fields logrus.Fields) (context.Context, *logrus.Entry) {
|
||||
if log := ctx.Value(LoggerKey); log != nil {
|
||||
log := log.(*logrus.Entry)
|
||||
log = log.WithFields(fields)
|
||||
AddMainLogger(ctx, log)
|
||||
return log
|
||||
ctx = AddMainLogger(ctx, log)
|
||||
return ctx, log
|
||||
}
|
||||
return nil
|
||||
return ctx, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user