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.42.0 lib/origen/logger_methods.rb
origen-0.41.2 lib/origen/logger_methods.rb
origen-0.41.1 lib/origen/logger_methods.rb
origen-0.41.0 lib/origen/logger_methods.rb
origen-0.40.2 lib/origen/logger_methods.rb
origen-0.40.1 lib/origen/logger_methods.rb
origen-0.40.0 lib/origen/logger_methods.rb
origen-0.38.0 lib/origen/logger_methods.rb
origen-0.37.0 lib/origen/logger_methods.rb
origen-0.36.1 lib/origen/logger_methods.rb
origen-0.36.0 lib/origen/logger_methods.rb
origen-0.35.1 lib/origen/logger_methods.rb
origen-0.35.0 lib/origen/logger_methods.rb
origen-0.34.3 lib/origen/logger_methods.rb
origen-0.34.2 lib/origen/logger_methods.rb
origen-0.34.1 lib/origen/logger_methods.rb
origen-0.34.0 lib/origen/logger_methods.rb
origen-0.33.3 lib/origen/logger_methods.rb
origen-0.33.2 lib/origen/logger_methods.rb
origen-0.33.1 lib/origen/logger_methods.rb