Browse Source

bootstrap, however on error no toto1 session

main
pvincent 2 months ago
parent
commit
3e5817e99e
  1. 7
      config/initializers/semantic_logger.rb
  2. 2
      lib/monkey_patches/action_dispatch/middleware/debug_exceptions.rb

7
config/initializers/semantic_logger.rb

@ -10,7 +10,14 @@ end
Rails.configuration.after_initialize do
Semantic::InstrumentationManager.clear
bootstrap = [{ kind: :restored, constant: 'ACTION_VIEW', type: :boolean, old_value: false, new_value: true },
{ kind: :restored, constant: 'ACTION_CONTROLLER', type: :boolean, old_value: false, new_value: true }]
im ||= Semantic::InstrumentationManager.new
im.process(bootstrap)
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event|
puts event.payload[:changes].inspect
im.process(event.payload[:changes])
rescue StandardError => e
puts e

2
lib/monkey_patches/action_dispatch/middleware/debug_exceptions.rb

@ -3,6 +3,7 @@ require 'action_dispatch/routing/inspector'
require 'action_view'
module ActionDispatch
module Middleware
# THIS IS A HACK TO unwrap TagWrapError when detected!
# TagWrapError contains a 'tag' for SemanticLogger and the cause itself
class DebugExceptions
@ -33,4 +34,5 @@ module ActionDispatch
end
end
end
end
end
Loading…
Cancel
Save