Module: Origen::LoggerMethods

Extended by:
ActiveSupport::Concern
Defined in:
lib/origen/logger_methods.rb

Instance Method Summary collapse

Instance Method Details

#alert(*args) ⇒ Object


34
35
36
37
# File 'lib/origen/logger_methods.rb', line 34

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

#deprecated(*lines) ⇒ Object


39
40
41
42
43
44
45
46
# File 'lib/origen/logger_methods.rb', line 39

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

#error(*args) ⇒ Object


29
30
31
32
# File 'lib/origen/logger_methods.rb', line 29

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

#highlightObject


48
49
50
51
52
53
54
# File 'lib/origen/logger_methods.rb', line 48

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

#logObject


14
15
16
# File 'lib/origen/logger_methods.rb', line 14

def log
  @log ||= Origen.log
end

#lputs(*args) ⇒ Object Also known as: lprint


18
19
20
# File 'lib/origen/logger_methods.rb', line 18

def lputs(*args)
  Origen.log.lputs(*args)
end

#warn(*args) ⇒ Object Also known as: warning


23
24
25
26
# File 'lib/origen/logger_methods.rb', line 23

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