Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing status codes to logs #830

Merged
merged 6 commits into from Jun 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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