Sha256: 70dce27a7ab3d427fe04d784fe40ea23a74d3360eb4456a555b6afeed23931a6

Contents?: true

Size: 689 Bytes

Versions: 127

Compression:

Stored size: 689 Bytes

Contents

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

Log = Log4r::Logger.new("filelog")        # create a logger
# add FileOutputter
Log.add Log4r::FileOutputter.new( "filelog", {:filename=>"file.log"} )

# See book keeping logger events
iLog = Log4r::Logger.new("log4r")
iLog.add Log4r::Outputter.stderr

# 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)
Log.level = Log4r::WARN
do_logging

Version data entries

127 entries across 89 versions & 15 rubygems

Version Path
vagrant-unbundled-2.2.0.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.1.4.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.1.2.0 vendor/bundle/ruby/2.3.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.1.1.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.0.4.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.0.3.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.5.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-2.0.0.1 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-1.9.8.1 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-1.9.7.1 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/log4r-1.1.10/examples/filelog.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/gems/log4r-1.1.10/examples/filelog.rb