thirteenth version
This commit is contained in:
@@ -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)`),
|
||||
|
||||
Reference in New Issue
Block a user