Class: Rumbrl::Grumble
Overview
Behance specific logger
Constant Summary collapse
- BASE_DATA_FORMAT =
"CHANNEL='%s' MESSAGE='%s'"- BASE_LOG_FORMAT =
"[%datetime%] LEVEL='%severity%' %message%"
Constants inherited from Log
Instance Attribute Summary
Attributes inherited from Log
Instance Method Summary collapse
-
#initialize(path, age, size) ⇒ Grumble
constructor
A new instance of Grumble.
- #method_missing(name, channel, message, **args) ⇒ Object
Methods inherited from Log
Constructor Details
#initialize(path, age, size) ⇒ Grumble
9 10 11 12 |
# File 'lib/rumbrl/grumble.rb', line 9 def initialize(path, age, size) super path, age, size, BASE_DATA_FORMAT, BASE_LOG_FORMAT self.datetime_format = '%F %T' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, channel, message, **args) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/rumbrl/grumble.rb', line 14 def method_missing(name, channel, , **args) format = BASE_LOG_FORMAT args.each { |k, v| format += " #{k.upcase}='#{v.gsub("'", '"')}'" } setup_format(format) super(*[name, channel, ]) end |