Sha256: 589b6b281459d1eace0d6b5690729c81cb57de1d11e48fb0893d5a6342fb9ae7

Contents?: true

Size: 926 Bytes

Versions: 90

Compression:

Stored size: 926 Bytes

Contents

# :stopdoc:
#
# Multiple loggers can be created and each can be configured with it's own
# log level and appenders. So one logger can be configured to output debug
# messages, and all the others can be left at the info or warn level. This
# makes it easier to debug specific portions of your code.
#

  require 'logging'

  # all loggers inherit the log level of the "root" logger
  # but specific loggers can be given their own level
  Logging.logger.root.level = :warn

  # similarly, the root appender will be used by all loggers
  Logging.logger.root.appenders = Logging.appenders.file('output.log')

  log1 = Logging.logger['Log1']
  log2 = Logging.logger['Log2']
  log3 = Logging.logger['Log3']

  # you can use strings or symbols to set the log level
  log3.level = 'debug'

  log1.info "this message will not get logged"
  log2.info "nor will this message"
  log3.info "but this message will get logged"

# :startdoc:

Version data entries

90 entries across 82 versions & 10 rubygems

Version Path
logging-2.4.0 examples/loggers.rb
logging-2.3.1 examples/loggers.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/logging-2.3.0/examples/loggers.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/logging-2.3.0/examples/loggers.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/logging-2.3.0/examples/loggers.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/logging-2.3.0/examples/loggers.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/logging-2.3.0/examples/loggers.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/logging-2.3.0/examples/loggers.rb
logging-2.3.0 examples/loggers.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/logging-2.2.2/examples/loggers.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/logging-2.2.2/examples/loggers.rb