Sha256: 3069a18f575a6e216af59971cda2af213190acdf80eedcf7c50a415cd7a8322b
Contents?: true
Size: 466 Bytes
Versions: 9
Compression:
Stored size: 466 Bytes
Contents
require "logger" module Fume class SmartLogger def self.create(name, log_level = Logger::DEBUG) logger = case name when "STDOUT" Logger.new(STDOUT) when /(\w+)/ Logger.new(Rails.root.join("log", "#{$1}.log")) when /(\w+\.\w+)/ Logger.new(Rails.root.join("log", $1)) else Logger.new(Rails.root.join("log", "#{Rails.env}.log")) end logger.level = log_level logger end end end
Version data entries
9 entries across 9 versions & 1 rubygems