|
|
@ -28,7 +28,6 @@ module Semantic |
|
|
|
end |
|
|
|
|
|
|
|
def call(log, logger) |
|
|
|
# puts 'ok2' |
|
|
|
log = alter(log) |
|
|
|
|
|
|
|
self.log = log |
|
|
@ -46,6 +45,17 @@ module Semantic |
|
|
|
|
|
|
|
private |
|
|
|
|
|
|
|
def tags |
|
|
|
first_tag = log.tags.empty? ? 'none' : log.tags.first |
|
|
|
first_tag.truncate(CENTER_SIZE).center(CENTER_SIZE) |
|
|
|
end |
|
|
|
|
|
|
|
def named_tags |
|
|
|
return if log.named_tags.empty? |
|
|
|
|
|
|
|
log.named_tags |
|
|
|
end |
|
|
|
|
|
|
|
def build_regex_redirected |
|
|
|
dev_port = Rails.application.routes.default_url_options[:port] |
|
|
|
dev_hosts = ['127.0.0.1', 'localhost', Rails.application.routes.default_url_options[:host]].uniq.join('|') |
|
|
@ -166,13 +176,10 @@ module Semantic |
|
|
|
log |
|
|
|
end |
|
|
|
|
|
|
|
def draw_fatal(char = CHAR_FATAL) |
|
|
|
BG_MAGENTA + BOLD + TEXT_WHITE + char + CLEAR |
|
|
|
end |
|
|
|
|
|
|
|
def draw_fatal(char = CHAR_FATAL) = BG_MAGENTA + BOLD + TEXT_WHITE + char + CLEAR |
|
|
|
def origin = colorize(centerize(log.name), TEXT_CYAN) |
|
|
|
def build_prefix(char) = "#{origin} ╣#{colorize(char)}╠ " |
|
|
|
def build_terminus = "#{origin} #{TERMINUS_STRING} " |
|
|
|
def build_prefix(char) = "#{tags} #{origin} ╣#{colorize(char)}╠ " |
|
|
|
def build_terminus = "#{tags} #{origin} #{TERMINUS_STRING} " |
|
|
|
def centerize(text) = text.truncate(CENTER_SIZE).center(CENTER_SIZE) |
|
|
|
def colorize(text, tint = color) = "#{tint}#{text}#{CLEAR}" |
|
|
|
|
|
|
@ -184,7 +191,7 @@ module Semantic |
|
|
|
end |
|
|
|
|
|
|
|
def build_dimensions(dimensions) |
|
|
|
"#{origin} #{dimensions.rails} " |
|
|
|
"#{tags} #{origin} #{dimensions.rails} " |
|
|
|
end |
|
|
|
|
|
|
|
def compute_useful_length |
|
|
|