Sha256: c74bfc7c42b676b1fc15cffa87e984a424e43a97cfb2efa517212c80acdf4726

Contents?: true

Size: 1.39 KB

Versions: 205

Compression:

Stored size: 1.39 KB

Contents

module Origen
  module LoggerMethods
    extend ActiveSupport::Concern

    included do |klass|
      Origen.deprecate <<-END
The LoggerMethods module is deprecated, use Origen.log instead (or just
log from within a class that includes Origen::Model). See here for the new API:
http://origen.freescale.net/origen/latest/guides/utilities/logger/
Called from the #{klass} class.
END
    end

    def log
      @log ||= Origen.log
    end

    def lputs(*args)
      Origen.log.lputs(*args)
    end
    alias_method :lprint, :lputs

    def warn(*args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      args.each { |arg| Origen.log.warn arg }
    end
    alias_method :warning, :warn

    def error(*args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      args.each { |arg| Origen.log.error arg }
    end

    def alert(*args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      args.each { |arg| Origen.log.warn arg }
    end

    def deprecated(*lines)
      options = lines.last.is_a?(Hash) ? lines.pop : {}
      lines.flatten.each do |line|
        line.split(/\n/).each do |line|
          Origen.log.deprecate line
        end
      end
    end

    def highlight
      lputs ''
      lputs '######################################################################'
      yield
      lputs '######################################################################'
      lputs ''
    end
  end
end

Version data entries

205 entries across 205 versions & 1 rubygems

Version Path
origen-0.60.17 lib/origen/logger_methods.rb
origen-0.60.16 lib/origen/logger_methods.rb
origen-0.60.14 lib/origen/logger_methods.rb
origen-0.60.13 lib/origen/logger_methods.rb
origen-0.60.12 lib/origen/logger_methods.rb
origen-0.60.11 lib/origen/logger_methods.rb
origen-0.60.10 lib/origen/logger_methods.rb
origen-0.60.9 lib/origen/logger_methods.rb
origen-0.60.8 lib/origen/logger_methods.rb
origen-0.60.7 lib/origen/logger_methods.rb
origen-0.60.6 lib/origen/logger_methods.rb
origen-0.60.5 lib/origen/logger_methods.rb
origen-0.60.4 lib/origen/logger_methods.rb
origen-0.60.3 lib/origen/logger_methods.rb
origen-0.60.2 lib/origen/logger_methods.rb
origen-0.60.1 lib/origen/logger_methods.rb
origen-0.60.0 lib/origen/logger_methods.rb
origen-0.59.8 lib/origen/logger_methods.rb
origen-0.59.7 lib/origen/logger_methods.rb
origen-0.59.6 lib/origen/logger_methods.rb