MCPcopy Create free account
hub / github.com/cli/cli / setLog

Function setLog

api/http_client.go:165–173  ·  view source on GitHub ↗

setLog configures the HTTP logger. A verbose log includes response headers and bodies as the server sent them, so its output is sanitized. It isn't colorized, since sanitizing would also neutralize the colors.

(clientOpts *ghAPI.ClientOptions, log io.Writer, colorize, verbose bool)

Source from the content-addressed store, hash-verified

163// setLog configures the HTTP logger. A verbose log includes response headers and bodies as the server sent them, so
164// its output is sanitized. It isn't colorized, since sanitizing would also neutralize the colors.
165func setLog(clientOpts *ghAPI.ClientOptions, log io.Writer, colorize, verbose bool) {
166 if verbose && log != nil {
167 log = sanitizingWriter{w: log}
168 colorize = false
169 }
170 clientOpts.Log = log
171 clientOpts.LogColorize = colorize
172 clientOpts.LogVerboseHTTP = verbose
173}
174
175// sanitizingWriter neutralizes terminal escape sequences and other control characters written through it.
176type sanitizingWriter struct {

Callers 2

NewHTTPClientFunction · 0.85
NewExternalHTTPClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected