interceptors: migrate to otel and add logging interceptor

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2024-10-17 17:15:05 +02:00
parent 9591a64e09
commit 3a3d77169c
41 changed files with 2817 additions and 852 deletions

View File

@ -33,7 +33,7 @@ func Set(ctx context.Context, logger Logger) context.Context {
func From(ctx context.Context) Logger {
log, ok := ctx.Value(log{}).(Logger)
if ok {
return log
return log.WithContext(ctx)
}
if defaultLogger != nil {
return defaultLogger
@ -42,5 +42,5 @@ func From(ctx context.Context) Logger {
mu.Lock()
defer mu.Unlock()
defaultLogger = logr
return defaultLogger
return defaultLogger.WithContext(ctx)
}