Sha256: 3f22847ac3be48606cc257edf9121e09128c4d151418d6a5d6ee1a723c1c3ab8

Contents?: true

Size: 606 Bytes

Versions: 11

Compression:

Stored size: 606 Bytes

Contents

# Here's how to start using log4r right away
$: << File.join('..','src')                   # path if log4r not installed
require "log4r"

Log = Log4r::Logger.new("outofthebox")        # create a logger
Log.add Log4r::Outputter.stderr               # which logs to stdout

# do some logging
def do_logging
 Log.debug "debugging"
 Log.info "a piece of info"
 Log.warn "Danger, Will Robinson, danger!"
 Log.error "I dropped my Wookie! :("
 Log.fatal "kaboom!"
end
do_logging

# now let's filter anything below WARN level (DEBUG and INFO)
puts "-= Changing level to WARN =-"
Log.level = Log4r::WARN
do_logging

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
sml-log4r-1.0.6 examples/outofthebox.rb
log4r-1.1.7 examples/outofthebox.rb
log4r-1.1.6 examples/outofthebox.rb
log4r-1.1.5 examples/outofthebox.rb
log4r-1.1.4 examples/outofthebox.rb
log4r-1.1.3 examples/outofthebox.rb
log4r-1.1.2 examples/outofthebox.rb
log4r-1.1.1 examples/outofthebox.rb
log4r-1.1.0 examples/outofthebox.rb
log4r-1.0.6 examples/outofthebox.rb
riess-0.0.8 vendor/log4r-1.0.5/examples/outofthebox.rb