|
@ -5,11 +5,12 @@ module Semantic |
|
|
@session_key = session_key |
|
|
@session_key = session_key |
|
|
|
|
|
|
|
|
force_preload_module |
|
|
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 |
|
|
once_and_reload do |
|
|
clear_subscribers(/\.action_controller$/) |
|
|
clear_subscribers(/\.action_controller$/) |
|
|
|
|
|
clear_subscribers(/\.action_view$/) |
|
|
|
|
|
|
|
|
append_ansi_formatter |
|
|
append_ansi_formatter |
|
|
reset_subscribers |
|
|
reset_subscribers |
|
|
register_log_subscriber |
|
|
register_log_subscriber |
|
@ -66,14 +67,13 @@ module Semantic |
|
|
|
|
|
|
|
|
ActiveSupport::Notifications.unsubscribe(sub) |
|
|
ActiveSupport::Notifications.unsubscribe(sub) |
|
|
end |
|
|
end |
|
|
ActiveSupport::LogSubscriber.subscribers.delete(subscriber) |
|
|
|
|
|
end |
|
|
end |
|
|
|
|
|
ActiveSupport::LogSubscriber.subscribers.delete(subscriber) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
# pattern could be either a string 'start_processing.action_controller' or a regex /\.action_controller$/ |
|
|
# pattern could be either a string 'start_processing.action_controller' or a regex /\.action_controller$/ |
|
|
def clear_subscribers(pattern) |
|
|
def clear_subscribers(pattern) |
|
|
ActiveSupport::LogSubscriber.subscribers.each { |sub| unattach(sub, pattern) } |
|
|
ActiveSupport::LogSubscriber.subscribers.each { |sub| unattach(sub, pattern) } |
|
|
ActiveSupport::Notifications.unsubscribe('start_processing.action_controller') |
|
|
|
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def reset_subscribers |
|
|
def reset_subscribers |
|
|