Sha256: 8f9a28f93fd87f4df82d035322725bbddc4787a3e6d85b0f488b17f907b46475

Contents?: true

Size: 835 Bytes

Versions: 10

Compression:

Stored size: 835 Bytes

Contents

module Hoth
  class Logger
    class <<self
      
      def log_provider=(log_provider)
        @log_provider = log_provider
      end
      
      def init_logging!
        Hoth::Logger.log_provider = if Object.const_defined?("Rails")
          Rails.logger
        else
          require 'logger'
          ::Logger.new("/tmp/hoth.log")
        end
      end
      
      def debug(msg)
        log_provider.debug msg
      end
      
      def info(msg)
        log_provider.info msg
      end
      
      def warn(msg)
        log_provider.warn msg
      end
      
      def error(msg)
        log_provider.error msg
      end
      
      def fatal(msg)
        log_provider.fatal msg
      end
      
      private
      
        def log_provider
          @log_provider || init_logging!
        end
    end
        
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
sk-hoth-0.3.5 lib/hoth/util/logger.rb
sk-hoth-0.3.4 lib/hoth/util/logger.rb
sk-hoth-0.3.2 lib/hoth/util/logger.rb
sk-hoth-0.3.1 lib/hoth/util/logger.rb
sk-hoth-0.3.0 lib/hoth/util/logger.rb
hoth-0.3.0 lib/hoth/util/logger.rb
hoth-0.2.2 lib/hoth/util/logger.rb
hoth-0.2.1 lib/hoth/util/logger.rb
hoth-0.1.2 lib/hoth/util/logger.rb
hoth-0.1.1 lib/hoth/util/logger.rb