require 'rubygems'
#require 'activerecord'
require 'logger'
log = Logger.new(STDERR)
log.sev_threshold = Logger::INFO
log.datetime_format = "%Y-%m-%d %H:%M:%S"
log.debug "debug"
log.info "info"
log.warn "warn"
log.error "error"
log.fatal "fatal"
Running this code will produce this lovely output:
I, [2009-09-02 10:49:39#27562] INFO -- : info
W, [2009-09-02 10:49:39#27562] WARN -- : warn
E, [2009-09-02 10:49:39#27562] ERROR -- : error
F, [2009-09-02 10:49:39#27562] FATAL -- : fatal
However, if I uncomment the require 'activerecord' line, I instead get this:
info
warn
error
fatal
Does anyone know any way to reference the old Logger class while still
using ActiveRecord?