Convenience functions for common operations LogErrorWithDetails logs an error with operation context
(operation string, err error, attrs ...slog.Attr)
| 103 | |
| 104 | // LogErrorWithDetails logs an error with operation context |
| 105 | func LogErrorWithDetails(operation string, err error, attrs ...slog.Attr) { |
| 106 | allAttrs := append([]slog.Attr{ |
| 107 | slog.String("operation", operation), |
| 108 | slog.String("error", err.Error()), |
| 109 | slog.Time("timestamp", time.Now()), |
| 110 | }, attrs...) |
| 111 | StructuredError("Operation failed", allAttrs...) |
| 112 | } |
| 113 | |
| 114 | // LogSuccessWithDetails logs a successful operation |
| 115 | func LogSuccessWithDetails(operation string, attrs ...slog.Attr) { |
nothing calls this directly
no test coverage detected