Sha256: 4f59ebde5cc806e83c3885b8ba8fd83b16d57fb86c9f1e338b9509157e67e188

Contents?: true

Size: 481 Bytes

Versions: 3

Compression:

Stored size: 481 Bytes

Contents

require 'logger'

module Marvin
  class Logger
    
    cattr_accessor :logger
    
    class << self
      
      def setup
        log_path = Marvin::Settings.root / "log/#{Marvin::Settings.environment}.log"
        self.logger ||= ::Logger.new(Marvin::Settings.daemon? ? log_path : STDOUT)
      end
      
      def method_missing(name, *args, &blk)
       self.setup # Ensure the logger is setup
       self.logger.send(name, *args, &blk)
      end
    
    end
    
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
Sutto-marvin-0.1.0.20081016 lib/marvin/logger.rb
Sutto-marvin-0.1.20081115 lib/marvin/logger.rb
jeffrafter-marvin-0.1.20081115 lib/marvin/logger.rb