From 851daf5e6a564d53fc43c3f102e1dc823c69d984 Mon Sep 17 00:00:00 2001 From: Peter Vandenberk Date: Mon, 6 Jan 2014 13:34:58 +0000 Subject: [PATCH] Width formatting for %T and % { def value(log_line, color) - foreground(log_line.upstream_response_time, color) + if color && Sickill::Rainbow.enabled + # 15 = 6 + 9, the extra amount of bytes required for the ANSI escape codes... + "%15s" % foreground(log_line.upstream_response_time, color) + else + "%6s" % log_line.upstream_response_time + end end } end @@ -81,7 +86,12 @@ grammar Formatting rule request_time '%T' { def value(log_line, color) - foreground(log_line.request_time, color) + if color && Sickill::Rainbow.enabled + # 15 = 6 + 9, the extra amount of bytes required for the ANSI escape codes... + "%15s" % foreground(log_line.request_time, color) + else + "%6s" % log_line.request_time + end end } end