MCPcopy Create free account
hub / github.com/dan-v/lambda-nat-proxy / LogErrorWithDetails

Function LogErrorWithDetails

pkg/shared/logger.go:105–112  ·  view source on GitHub ↗

Convenience functions for common operations LogErrorWithDetails logs an error with operation context

(operation string, err error, attrs ...slog.Attr)

Source from the content-addressed store, hash-verified

103
104// LogErrorWithDetails logs an error with operation context
105func 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
115func LogSuccessWithDetails(operation string, attrs ...slog.Attr) {

Callers

nothing calls this directly

Calls 2

StructuredErrorFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected