MCPcopy Create free account
hub / github.com/github/gh-aw / logSanitizeInput

Function logSanitizeInput

pkg/stringutil/sanitize.go:106–118  ·  view source on GitHub ↗

logSanitizeInput logs input parameters when debug logging is enabled.

(name string, opts *SanitizeOptions)

Source from the content-addressed store, hash-verified

104
105// logSanitizeInput logs input parameters when debug logging is enabled.
106func logSanitizeInput(name string, opts *SanitizeOptions) {
107 if !sanitizeLog.Enabled() {
108 return
109 }
110 preserveCount := 0
111 trimHyphens := false
112 if opts != nil {
113 preserveCount = len(opts.PreserveSpecialChars)
114 trimHyphens = opts.TrimHyphens
115 }
116 sanitizeLog.Printf("Sanitizing name: input=%q, preserve_chars=%d, trim_hyphens=%t",
117 name, preserveCount, trimHyphens)
118}
119
120// normalizeSanitizeSeparators converts common separators to hyphens and optionally
121// converts underscores when they are not in the preserve list.

Callers 1

SanitizeNameFunction · 0.85

Calls 2

EnabledMethod · 0.45
PrintfMethod · 0.45

Tested by

no test coverage detected