thirteenth version

This commit is contained in:
2026-06-09 21:04:01 +00:00
parent f877907b20
commit 4dec14f57c
19 changed files with 602 additions and 110 deletions
+10
View File
@@ -34,6 +34,12 @@ type SDKLogger struct {
Logger *slog.Logger
}
type NoopSDKLogger struct{}
func NewSDKLogger(logger *slog.Logger) SDKLogger {
return SDKLogger{Logger: logger}
}
func (l SDKLogger) Infof(template string, args ...any) {
if l.Logger != nil {
l.Logger.Info(RedactString(template), "args", redactArgs(args))
@@ -52,6 +58,10 @@ func (l SDKLogger) Fatalf(template string, args ...any) {
}
}
func (NoopSDKLogger) Infof(string, ...any) {}
func (NoopSDKLogger) Errorf(string, ...any) {}
func (NoopSDKLogger) Fatalf(string, ...any) {}
var sensitiveStringPatterns = []*regexp.Regexp{
regexp.MustCompile(`(?i)((?:account[_-]?id|token)\s*[:=]\s*)("[^"]+"|'[^']+'|[^\s,}]+)`),
regexp.MustCompile(`(?i)("(?:accountID|accountId|account_id|token)"\s*:\s*)("[^"]*"|null)`),