Sha256: 4c38dedceffa3baf4250413b34c11db25cd5fe526543c2819f5c4f1a4e68ffd5

Contents?: true

Size: 433 Bytes

Versions: 7

Compression:

Stored size: 433 Bytes

Contents

require 'logger'
class UnitLogger

  def self.method_missing(meth, *args, &block)
    return Rails.logger.send(meth, *args, &block) if defined? Rails
    return unit.send(meth, *args, &block)
  end

  def self.unit
    return @logger unless @logger.nil?
    @logger = Logger.new(STDOUT)
    @logger.formatter = proc do |severity, datetime, progname, msg|
      msg
    end
    @logger.level = Logger::DEBUG
    @logger
  end

end



Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_mocker-1.4.2 sample_app_rails_4/lib/unit_logger.rb
active_mocker-1.4.1 sample_app_rails_4/lib/unit_logger.rb
active_mocker-1.3.2 sample_app_rails_4/lib/unit_logger.rb
active_mocker-1.3.1 sample_app_rails_4/lib/unit_logger.rb
active_mocker-1.3 sample_app_rails_4/lib/unit_logger.rb
active_mocker-1.2.4 sample_app_rails_4/lib/unit_logger.rb
active_mocker-1.2.3 sample_app_rails_4/lib/unit_logger.rb