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

Function LogSuccess

pkg/shared/errors.go:30–46  ·  view source on GitHub ↗

LogSuccess logs a success message with emoji prefix

(operation string, details ...interface{})

Source from the content-addressed store, hash-verified

28
29// LogSuccess logs a success message with emoji prefix
30func LogSuccess(operation string, details ...interface{}) {
31 var msg string
32 attrs := []slog.Attr{
33 slog.String("operation", operation),
34 slog.Time("timestamp", time.Now()),
35 }
36
37 if len(details) > 0 {
38 detailStr := fmt.Sprint(details...)
39 msg = fmt.Sprintf("✅ %s: %v", operation, detailStr)
40 attrs = append(attrs, slog.String("details", detailStr))
41 } else {
42 msg = fmt.Sprintf("✅ %s", operation)
43 }
44
45 GetLogger().LogAttrs(context.Background(), slog.LevelInfo, msg, attrs...)
46}
47
48// LogSuccessf logs a formatted success message with emoji prefix
49func LogSuccessf(format string, args ...interface{}) {

Callers 2

handleHolePunchRequestFunction · 0.92
startQUICClientFunction · 0.92

Calls 1

GetLoggerFunction · 0.85

Tested by

no test coverage detected