Browse Source

no stack from formatter

pagy
pvincent 11 months ago
parent
commit
34281c9a7f
  1. 1
      app/controllers/scores_controller.rb
  2. 3
      lib/formatter/colored_formatter.rb

1
app/controllers/scores_controller.rb

@ -9,6 +9,7 @@ class ScoresController < ApplicationController
logger.warn 'this is a warning'
logger.error 'this is an error'
logger.debug 'this is a debug message'
logger.fatal 'FATAL'
logger.info @scores
end

3
lib/formatter/colored_formatter.rb

@ -3,7 +3,8 @@ require 'rainbow'
# ColoredFormatter outputs colored message according to severity
class ColoredFormatter < Logger::Formatter
def call(severity, _time, _program_name, message) # rubocop:disable Metrics/MethodLength
msg = message.is_a?(String) ? message : message.inspect
# msg = message.is_a?(String) ? message : message.inspect
msg = message
tint = case severity
when 'DEBUG'
:darkgray

Loading…
Cancel
Save