module Kiev
Keep this class minimal and compatible with Ruby Logger
. If you add custom methods to this class and they will be used by developer, it will be hard to swap this class with any other Logger
implementation.
Constants
- EMPTY_OBJ
- VERSION
Public Class Methods
[]=(name, value)
click to toggle source
# File lib/kiev/base.rb, line 45 def []=(name, value) RequestStore.store[:payload] ||= {} RequestStore.store[:payload][name] = value end
configure() { |instance| ... }
click to toggle source
# File lib/kiev/base.rb, line 21 def configure yield(Config.instance) end
error=(value)
click to toggle source
# File lib/kiev/base.rb, line 57 def error=(value) RequestStore.store[:error] = value end
event(event_name, data = EMPTY_OBJ)
click to toggle source
# File lib/kiev/base.rb, line 37 def event(event_name, data = EMPTY_OBJ) logger.log( ::Logger::Severity::INFO, ParamFilter.filter(data, filtered_params, ignored_params), event_name ) end
filtered_params()
click to toggle source
# File lib/kiev/base.rb, line 29 def filtered_params Config.instance.filtered_params end
ignored_params()
click to toggle source
# File lib/kiev/base.rb, line 33 def ignored_params Config.instance.ignored_params end
logger()
click to toggle source
# File lib/kiev/base.rb, line 25 def logger Config.instance.logger end
payload(data)
click to toggle source
# File lib/kiev/base.rb, line 50 def payload(data) raise ArgumentError, "Hash expected" unless data.is_a?(Hash) RequestStore.store[:payload] ||= {} RequestStore.store[:payload].merge!(data) end
request_id()
click to toggle source
# File lib/kiev/base.rb, line 61 def request_id RequestStore.store[:tracking_id] end
Also aliased as: tracking_id