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
Returns a new instance of Grumble.
10 11 12 13 |
# File 'lib/rumbrl/grumble.rb', line 10 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
15 16 17 18 19 20 21 22 23 |
# File 'lib/rumbrl/grumble.rb', line 15 def method_missing(name, channel, , **args) format = BASE_LOG_FORMAT args = Smash.flatten(args) args.each do |k, v| format += " #{k.to_s.upcase}='#{v.to_s.gsub("'", '"')}'" end setup_format(format) super(*[name, channel, ]) end |