Browse Source

log_subscriber **_options

main
pvincent 2 months ago
parent
commit
ff95f35abd
  1. 5
      lib/semantic/instrumentalizer.rb
  2. 2
      lib/semantic/subscribers/action_view.rb
  3. 2
      lib/semantic/subscribers/log_subscriber.rb

5
lib/semantic/instrumentalizer.rb

@ -65,12 +65,7 @@ module Semantic
def build_log_subscriber_from(event_group)
classname = event_group.to_s.camelize
options = Rails.application.config.x.send(event_group).to_h
case classname
when 'ActionController'
Semantic::Subscribers.const_get(classname).new(**options)
else
Semantic::Subscribers.const_get(classname).new
end
end
end
end

2
lib/semantic/subscribers/action_view.rb

@ -6,7 +6,7 @@ module Semantic
REGEX_BASEDIR = %r{^#{Rails.root}/(.*)}
def initialize = super(:view)
def initialize(*) = super(:view)
def render_partial(event)
identifier = pathname(event.payload[:identifier])

2
lib/semantic/subscribers/log_subscriber.rb

@ -4,7 +4,7 @@ module Semantic
class LogSubscriber
attr_reader :logger, :event_group
def initialize(logger_name = nil)
def initialize(logger_name = nil, **_options)
@event_group = self.class.name.demodulize.underscore.to_sym
@logger = SemanticLogger[logger_name || @event_group]
end

Loading…
Cancel
Save