Browse Source

no more actionview

main
pvincent 3 months ago
parent
commit
c93aca9daa
  1. 8
      lib/semantic/dev_loader.rb
  2. 4
      lib/semantic/log_subscriber.rb

8
lib/semantic/dev_loader.rb

@ -5,11 +5,12 @@ module Semantic
@session_key = session_key
force_preload_module
RailsSemanticLogger::ActionController::LogSubscriber.logger.level = :fatal
clear_subscribers(/\.action_controller$/)
RailsSemanticLogger::ActionController::LogSubscriber.logger.level = :fatal # useful for remanent Rack::Log started
once_and_reload do
clear_subscribers(/\.action_controller$/)
clear_subscribers(/\.action_view$/)
append_ansi_formatter
reset_subscribers
register_log_subscriber
@ -66,14 +67,13 @@ module Semantic
ActiveSupport::Notifications.unsubscribe(sub)
end
ActiveSupport::LogSubscriber.subscribers.delete(subscriber)
end
ActiveSupport::LogSubscriber.subscribers.delete(subscriber)
end
# pattern could be either a string 'start_processing.action_controller' or a regex /\.action_controller$/
def clear_subscribers(pattern)
ActiveSupport::LogSubscriber.subscribers.each { |sub| unattach(sub, pattern) }
ActiveSupport::Notifications.unsubscribe('start_processing.action_controller')
end
def reset_subscribers

4
lib/semantic/log_subscriber.rb

@ -61,9 +61,9 @@ module Semantic
logger.error process_duration(event, additions)
elsif event.duration >= 600
logger.warn process_duration(event, additions)
elsif event.duration >= 250
elsif event.duration >= 300
logger.info process_duration(event, additions)
elsif event.duration >= 80
elsif event.duration >= 100
logger.debug process_duration(event, additions)
end

Loading…
Cancel
Save