Module: Cabin::Mixins::CAPSLOCK
- Defined in:
- lib/cabin/mixins/CAPSLOCK.rb
Overview
ALL CAPS MEANS SERIOUS BUSINESS
Instance Method Summary collapse
Instance Method Details
#log(level, message, data = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cabin/mixins/CAPSLOCK.rb', line 5 def log(level, , data={}) if .is_a?(Hash) data.merge!() else data[:message] = end # CAPITALIZE ALL THE STRINGS data.each do |key, value| value.upcase! if value.respond_to?(:upcase!) end # Add extra debugging bits (file, line, method) if level is debug. debugharder(caller.collect { |c| c.upcase }, data) if @level == :debug data[:level] = level.upcase publish(data) end |