MCPcopy
hub / github.com/keploy/keploy / LogError

Function LogError

utils/utils.go:308–316  ·  view source on GitHub ↗

func ModifyToSentryLogger(ctx context.Context, logger *zap.Logger, client *sentry.Client, configDb *configdb.ConfigDb) *zap.Logger { cfg := zapsentry.Configuration{ Level: zapcore.ErrorLevel, //when to send message to sentry EnableBreadcrumbs: true, // enable sending b

(logger *zap.Logger, err error, msg string, fields ...zap.Field)

Source from the content-addressed store, hash-verified

306
307// LogError logs the error with the provided fields if the error is not context.Canceled.
308func LogError(logger *zap.Logger, err error, msg string, fields ...zap.Field) {
309 if logger == nil {
310 fmt.Println("Failed to log error. Logger is nil.")
311 return
312 }
313 if !errors.Is(err, context.Canceled) {
314 logger.Error(msg, append(fields, zap.Error(err))...)
315 }
316}
317
318// RemoveDoubleQuotes removes all double quotes from the values in the provided template map.
319// This function handles cases where the templating engine fails to parse values containing both single and double quotes.

Callers 15

startFunction · 0.92
SimulateGRPCFunction · 0.92
prepareHTTPRequestFunction · 0.92
SimulateHTTPFunction · 0.92
SimulateHTTPStreamingFunction · 0.92
DecompressFunction · 0.92
CompressFunction · 0.92
ResolveTestTargetFunction · 0.92
UnmarshallJSONFunction · 0.92
MatchFunction · 0.92
MatchSchemaFunction · 0.92

Calls 1

ErrorMethod · 0.45

Tested by 1

TestFunction · 0.74