Sha256: 2175792b406bb11c132e5b3a174fff244077c6911d49eea8e3dda078a59ad78b

Contents?: true

Size: 1.38 KB

Versions: 11

Compression:

Stored size: 1.38 KB

Contents

module RTALogger
  # Logging severity.
  module SeverityLevel
    # all information that helps us to trace the processing of an incoming request through our application
    TRACE = 0
    # Low-level information, mostly for developers.
    DEBUG = 1
    # Generic (useful) information about system operation.
    INFO = 2
    # A warning.
    WARN = 3
    # A handleable error condition.
    ERROR = 4
    # An un-handleable error that results in a program crash.
    FATAL = 5
    # An unknown message that should always be logged.
    UNKNOWN = 6


    def parse_severity_level_to_i(severity_level)
      return severity_level if severity_level.is_a? ::Integer

      case severity_level.upcase
      when 'TRACE'
        0
      when 'DEBUG'
        1
      when 'INFO'
        2
      when 'INFORMATIONŮ‘Ů”'
        2
      when 'WARN'
        3
      when 'WARNING'
        5
      when 'ERROR'
        4
      when 'FATAL'
        5
      when 'UNKNOWN'
        6
      else
        2
      end
  end

  def parse_severity_level_to_s(severity_level)
    return severity_level if severity_level.is_a? ::String

    case severity_level.to_i
    when 0
      'TRACE'
    when 1
      'DEBUG'
    when 2
      'INFO'
    when 3
      'WARN'
    when 4
      'ERROR'
    when 5
      'FATAL'
    when 6
      'UNKNOWN'
    end
  end
end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
RTALogger-2.4.0 lib/severity_level.rb
RTALogger-2.3.1 lib/severity_level.rb
RTALogger-2.3.0 lib/severity_level.rb
RTALogger-2.2.2 lib/severity_level.rb
RTALogger-2.2.0 lib/severity_level.rb
RTALogger-2.1.2 lib/severity_level.rb
RTALogger-2.1.1 lib/severity_level.rb
RTALogger-2.1.0 lib/severity_level.rb
RTALogger-2.0.2 lib/severity_level.rb
RTALogger-2.0.1 lib/severity_level.rb
RTALogger-2.0.0 lib/severity_level.rb