Module: Origen::LoggerMethods
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/origen/logger_methods.rb
Instance Method Summary collapse
- #alert(*args) ⇒ Object
- #deprecated(*lines) ⇒ Object
- #error(*args) ⇒ Object
- #highlight ⇒ Object
- #log ⇒ Object
- #lputs(*args) ⇒ Object (also: #lprint)
- #warn(*args) ⇒ Object (also: #warning)
Instance Method Details
#alert(*args) ⇒ Object
34 35 36 37 |
# File 'lib/origen/logger_methods.rb', line 34 def alert(*args) = 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) = 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) = args.last.is_a?(Hash) ? args.pop : {} args.each { |arg| Origen.log.error arg } end |
#highlight ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/origen/logger_methods.rb', line 48 def highlight lputs '' lputs '######################################################################' yield lputs '######################################################################' lputs '' end |
#log ⇒ Object
14 15 16 |
# File 'lib/origen/logger_methods.rb', line 14 def log @log ||= Origen.log end |