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