Sha256: 97ad537c390341f1a91405ca05b5cd939796cda4db416b072efb3522b0cbf2f6

Contents?: true

Size: 386 Bytes

Versions: 2

Compression:

Stored size: 386 Bytes

Contents

require "logger"

module Fume
  class SmartLogger
    def self.create(name)
      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fume-0.3.4 lib/fume/smart_logger.rb
fume-0.3.3 lib/fume/smart_logger.rb