Skip to content

Commit

Permalink
Add missing status codes to logs (#830)
Browse files Browse the repository at this point in the history
* Add missing status codes on logs

* Use range

* Add missing then
  • Loading branch information
faustinoaq authored and robacarp committed Jun 13, 2018
1 parent 1a8d490 commit 7aea00e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/amber/pipes/logger.cr
Expand Up @@ -51,12 +51,13 @@ module Amber

private def http_status(status)
case status
when 200
text = "200 ".colorize(:green)
when 404
text = "404 ".colorize(:red)
when 200..299 then status.colorize(:green)
when 300..399 then status.colorize(:blue)
when 400..499 then status.colorize(:yellow)
when 500..599 then status.colorize(:red)
else
status.colorize(:white)
end
"#{text}"
end

private def elapsed_text(elapsed)
Expand Down

0 comments on commit 7aea00e

Please sign in to comment.