fix: replace nil context with context.TODO
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package observability
|
||||
|
||||
import "context"
|
||||
|
||||
// Small helpers to keep logging consistent and low-friction across the codebase.
|
||||
|
||||
func Info(event string, component string, message string, fields map[string]any) {
|
||||
@@ -10,6 +12,14 @@ func Warn(event string, component string, message string, fields map[string]any,
|
||||
LogJSON(LogLevelWarn, event, component, message, fields, err)
|
||||
}
|
||||
|
||||
func WarnContext(ctx context.Context, event string, component string, message string, fields map[string]any, err error) {
|
||||
LogContext(ctx, LogLevelWarn, event, component, message, fields, err)
|
||||
}
|
||||
|
||||
func Error(event string, component string, message string, fields map[string]any, err error) {
|
||||
LogJSON(LogLevelError, event, component, message, fields, err)
|
||||
}
|
||||
|
||||
func ErrorContext(ctx context.Context, event string, component string, message string, fields map[string]any, err error) {
|
||||
LogContext(ctx, LogLevelError, event, component, message, fields, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user