diff --git a/lib/rackstash.rb b/lib/rackstash.rb index 3aff091..0f50977 100644 --- a/lib/rackstash.rb +++ b/lib/rackstash.rb @@ -45,6 +45,16 @@ module Rackstash 'ANY'.freeze ].freeze + def self.severity_label(severity) + if severity.is_a?(Integer) + return SEVERITY_LABELS.last if severity < 0 + SEVERITY_LABELS[severity] || SEVERITY_LABELS.last + else + severity = SEVERITY_NAMES.fetch(severity.to_s.downcase, UNKNOWN) + SEVERITY_LABELS[severity] + end + end + PROGNAME = "rackstash/v#{Rackstash::VERSION}".freeze # A class for the {UNDEFINED} object. Generally, there will only be exactly @@ -85,16 +95,6 @@ module Rackstash FIELD_ERROR_MESSAGE = 'error_message'.freeze FIELD_ERROR_TRACE = 'error_trace'.freeze - def self.severity_label(severity) - if severity.is_a?(Integer) - return SEVERITY_LABELS.last if severity < 0 - SEVERITY_LABELS[severity] || SEVERITY_LABELS.last - else - severity = SEVERITY_NAMES.fetch(severity.to_s.downcase, UNKNOWN) - SEVERITY_LABELS[severity] - end - end - # Returns a {Flow} which is used by the normal logger {Flow}s to write details # about any unexpected errors during interaction with their {Adapters}. #