|
|
@ -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 |
|
|
|