Sha256: d75b5e73b9c93f37d95fb43bd8f3e4b5ba0206246e868959c47453c088914176

Contents?: true

Size: 767 Bytes

Versions: 10

Compression:

Stored size: 767 Bytes

Contents

module Hoth
  class Logger
    class <<self

      def log_provider=(log_provider)
        @log_provider = log_provider
      end

      def init_logging!(logfile="log/hoth.log")
        Hoth::Logger.log_provider = if Object.const_defined?("Rails")
          Rails.logger
        else
          require 'logger'
          ::Logger.new(logfile)
        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

      def log_provider
        @log_provider || init_logging!
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hoth-0.4.2 lib/hoth/util/logger.rb
hoth-0.4.1 lib/hoth/util/logger.rb
hoth-0.4.0 lib/hoth/util/logger.rb
hoth-0.3.4 lib/hoth/util/logger.rb
hoth-0.3.3 lib/hoth/util/logger.rb
hoth-0.3.2.beta4 lib/hoth/util/logger.rb
hoth-0.3.2.beta3 lib/hoth/util/logger.rb
hoth-0.3.2.beta2 lib/hoth/util/logger.rb
hoth-0.3.2.beta1 lib/hoth/util/logger.rb
hoth-0.3.1 lib/hoth/util/logger.rb