Sha256: 22ccba368aa15286408462f06185fe4da3fc5cde4ef97641338e643cd21e83a7

Contents?: true

Size: 940 Bytes

Versions: 3

Compression:

Stored size: 940 Bytes

Contents

require 'soar_auditor_api'
require 'byebug'

class SanityAuditor < SoarAuditorApi::AuditorAPI
  def configuration_is_valid(configuration)
    return configuration.include?("preprefix")
  end

  def audit(data)
    puts @configuration["preprefix"] + data
  end
end

class Main
  def test_sanity
    @iut = SanityAuditor.new
    configuration = { "preprefix" => "very important:" }
    @iut.configure(configuration)
    @iut.set_audit_level(:debug)

    some_debug_object = 123
    @iut.info("This is info")
    @iut.debug(some_debug_object)
    dropped = 95
    @iut.warn("Statistics show that dropped packets have increased to #{dropped}%")
    @iut.error("Could not resend some dropped packets. They have been lost. All is still OK, I could compensate")
    @iut.fatal("Unable to perform action, too many dropped packets. Functional degradation.")
    @iut << 'Rack::CommonLogger requires this'
  end
end

main = Main.new
main.test_sanity

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
soar_auditor_api-0.0.5 sanity/sanity.rb
soar_auditor_api-0.0.4 sanity/sanity.rb
soar_auditor_api-0.0.3 sanity/sanity.rb