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

Function LogNetwork

pkg/shared/errors.go:142–158  ·  view source on GitHub ↗

LogNetwork logs a network-related message with emoji prefix

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

Source from the content-addressed store, hash-verified

140
141// LogNetwork logs a network-related message with emoji prefix
142func LogNetwork(operation string, details ...interface{}) {
143 var msg string
144 attrs := []slog.Attr{
145 slog.String("operation", operation),
146 slog.Time("timestamp", time.Now()),
147 }
148
149 if len(details) > 0 {
150 detailStr := fmt.Sprint(details...)
151 msg = fmt.Sprintf("🌐 %s: %v", operation, detailStr)
152 attrs = append(attrs, slog.String("details", detailStr))
153 } else {
154 msg = fmt.Sprintf("🌐 %s", operation)
155 }
156
157 GetLogger().LogAttrs(context.Background(), slog.LevelInfo, msg, attrs...)
158}
159
160// LogNetworkf logs a formatted network message with emoji prefix
161func LogNetworkf(format string, args ...interface{}) {

Calls 1

GetLoggerFunction · 0.85

Tested by

no test coverage detected