Skip to content
Myr

chore(http): use white color for HTTP 1XX (#3741)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Viral Parmar · committed by GitHub · parent c2ba8f1 · Browse files · 2 files+3 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−0 removed

  • other:+3 added−0 removed

2 files+3 added−0 removed

modified:logger_test.go+1 added
308 unmodified lines
309 }310 return p.StatusCodeColor()311 }312313 assert.Equal(t, white, colorForStatus(http.StatusContinue), "1xx should be white")314 assert.Equal(t, green, colorForStatus(http.StatusOK), "2xx should be green")315 assert.Equal(t, white, colorForStatus(http.StatusMovedPermanently), "3xx should be white")316 assert.Equal(t, yellow, colorForStatus(http.StatusNotFound), "4xx should be yellow")317 assert.Equal(t, red, colorForStatus(2), "other things should be red")
119 unmodified lines
modified:logger.go+2 added
81 unmodified lines
82func (p *LogFormatterParams) StatusCodeColor() string {83 code := p.StatusCode8485 switch {86 case code >= http.StatusContinue && code < http.StatusOK:87 return white88 case code >= http.StatusOK && code < http.StatusMultipleChoices:89 return green90 case code >= http.StatusMultipleChoices && code < http.StatusBadRequest:91 return white
181 unmodified lines