|
@ -3,15 +3,26 @@ module Semantic |
|
|
class DevLoader |
|
|
class DevLoader |
|
|
def initialize(session_key) |
|
|
def initialize(session_key) |
|
|
@session_key = session_key |
|
|
@session_key = session_key |
|
|
|
|
|
|
|
|
force_preload_module |
|
|
force_preload_module |
|
|
|
|
|
|
|
|
once_and_reload do |
|
|
once_and_reload do |
|
|
append_ansi_formatter |
|
|
append_ansi_formatter |
|
|
register_log_subscriber |
|
|
register_log_subscriber |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
# FIXME: when final |
|
|
|
|
|
# Rails.logger.level = :error |
|
|
|
|
|
|
|
|
# FIXME: proper unsubscribe!!! |
|
|
|
|
|
RailsSemanticLogger::ActionController::LogSubscriber.logger.level = :fatal |
|
|
|
|
|
# RailsSemanticLogger.swap_subscriber( |
|
|
|
|
|
# RailsSemanticLogger::ActionController::LogSubscriber, |
|
|
|
|
|
# @log_subscriber, # attach missing!!! |
|
|
|
|
|
# :action_controller |
|
|
|
|
|
# ) |
|
|
|
|
|
|
|
|
|
|
|
# ActiveSupport::LogSubscriber.subscribers.each do |sub| |
|
|
|
|
|
# puts "subscriber #{sub.pattern}" |
|
|
|
|
|
# end |
|
|
|
|
|
# RailsSemanticLogger.swap_subscriber(RailsSemanticLogger::ActionController::LogSubscriber, |
|
|
|
|
|
# @log_subscriber, :action_controller) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
private |
|
|
private |
|
|