Sha256: 7524f1338c7e5e1c32004d1e85303b25c3a7e4e1247bb58adad5783b51b7e531

Contents?: true

Size: 437 Bytes

Versions: 7

Compression:

Stored size: 437 Bytes

Contents

require 'rubygems'
require 'tagged_logger'
require 'logger'

puts "\n<<<#{File.basename(__FILE__, ".rb")}>>> \n".upcase

TaggedLogger.rules do
  info /.*/, :to => Logger.new(STDOUT)
end

class A
  def foo
    logger.warn "WARNING message" #will be printed since treshold is set to 'info'
  end
  logger.debug "DEBUG message" #will not be printed since we have only 'info' rule
end

logger.info("INFO message") #will be printed
A.new.foo

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tagged_logger-0.4.5 examples/simplest_usage.rb
tagged_logger-0.4.2 examples/simplest_usage.rb
tagged_logger-0.4.0 examples/simplest_usage.rb
tagged_logger-0.3.3 examples/simplest_usage.rb
tagged_logger-0.3.2 examples/simplest_usage.rb
tagged_logger-0.3.1 examples/simplest_usage.rb
tagged_logger-0.3.0 examples/simplest_usage.rb