Sha256: 6ba8ad14c13f2c7b01217a90d8c742489df76f1013a67739143412106b9b35d0
Contents?: true
Size: 627 Bytes
Versions: 33
Compression:
Stored size: 627 Bytes
Contents
module Dbox module Loggable def self.included receiver receiver.extend ClassMethods end module ClassMethods def log Dbox.log end end def log Dbox.log end end def self.log @logger ||= setup_logger end def self.setup_logger if defined?(LOGGER) LOGGER elsif defined?(Rails.logger) Rails.logger else l = Logger.new(STDOUT) l.level = (ENV["DEBUG"] && ENV["DEBUG"] != "false") ? Logger::DEBUG : Logger::INFO l.formatter = proc {|severity, datetime, progname, msg| "[#{severity}] #{msg}\n" } l end end end
Version data entries
33 entries across 33 versions & 1 rubygems