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.33.0 lib/origen/logger_methods.rb
origen-0.32.1 lib/origen/logger_methods.rb
origen-0.32.0 lib/origen/logger_methods.rb
origen-0.31.0 lib/origen/logger_methods.rb
origen-0.30.0 lib/origen/logger_methods.rb
origen-0.29.0 lib/origen/logger_methods.rb
origen-0.28.2 lib/origen/logger_methods.rb
origen-0.28.1 lib/origen/logger_methods.rb
origen-0.28.0 lib/origen/logger_methods.rb
origen-0.27.0 lib/origen/logger_methods.rb
origen-0.26.0 lib/origen/logger_methods.rb
origen-0.25.1 lib/origen/logger_methods.rb
origen-0.25.0 lib/origen/logger_methods.rb
origen-0.24.0 lib/origen/logger_methods.rb
origen-0.23.0 lib/origen/logger_methods.rb
origen-0.22.0 lib/origen/logger_methods.rb
origen-0.21.0 lib/origen/logger_methods.rb
origen-0.20.3 lib/origen/logger_methods.rb
origen-0.20.2 lib/origen/logger_methods.rb
origen-0.20.1 lib/origen/logger_methods.rb