79439718

Date: 2025-02-14 14:47:07
Score: 1.5
Natty:
Report link

I couldn't get the solution suggested by @Lucas to work as I wanted to insert an extra level - my solution was along the following lines...

class UWS_Logger < Logger
  verb = $VERBOSE
  $VERBOSE = nil
  SEVS = %w(DEBUG TRACE INFO WARN ERROR FATAL UNKNOWN).each_with_index do |c, i|
    Logger::Severity.const_set(c, i)
  end
  $VERBOSE = verb

  def format_severity(severity)
    SEVS[severity] || 'ANY'
  end
end
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Lucas
  • Low reputation (1):
Posted by: David Pointon