Sha256: d5f2714b7ffae22d4352e6656ce56e7b9c6e2a62b0294f8cd656392009e594db

Contents?: true

Size: 988 Bytes

Versions: 1

Compression:

Stored size: 988 Bytes

Contents

require 'log4r'
require 'soar_auditing_provider'
require 'byebug'

class Log4rAuditingProvider < SoarAuditingProvider::AuditingProviderAPI
  def configure_auditor(auditor, configuration = nil)
    auditor.outputters = configuration['outputter']
  end

  def select(nfrs)
    super(nfrs)
  end  
end

class Main
  include Log4r
  
  def test_sanity
    auditor_configuration = { 'outputter' => Outputter.stdout }
    @iut = Log4rAuditingProvider.new( { Logger => auditor_configuration } ).select

    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

1 entries across 1 versions & 1 rubygems

Version Path
soar_auditing_provider-0.5.0 sanity/sanity.rb