File: rails4.rb

package info (click to toggle)
ruby-logging 2.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 660 kB
  • sloc: ruby: 6,139; sh: 11; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# :stopdoc:
#
# Rails 4 allows you to hook up multiple loggers (even those external to this gem)
# so you can use a single Rails.logger statement. For Rails developers, this is
# easier because if you ever change logging frameworks, you don't have to change
# all of your app code.
#
# See http://railsware.com/blog/2014/08/07/rails-logging-into-several-backends/
#

require 'logging'

log = Logging.logger(STDOUT)
log.level = :warn

Rails.logger.extend(ActiveSupport::Logger.broadcast(log))

Rails.logger.debug "this debug message will not be output by the logger"
Rails.logger.warn "this is your last warning"

# :startdoc: