lib/rack/insight/config.rb in rack-insight-0.5.27 vs lib/rack/insight/config.rb in rack-insight-0.5.28
- old
+ new
@@ -14,11 +14,11 @@
}
class << self
attr_reader :config, :verbosity, :log_file, :log_level, :rails_log_copy,
:filtered_backtrace, :panel_configs, :silence_magic_insight_warnings,
- :database
+ :database, :handle_javascript
end
@log_file = STDOUT
@log_level = ::Logger::DEBUG
@logger = nil
@verbosity = nil
@@ -46,10 +46,11 @@
@silence_magic_insight_warnings = false
@database = {
:raise_encoding_errors => false, # Either way will be logged
:raise_decoding_errors => true, # Either way will be logged
}
+ @handle_javascript = true # Set false if you want to handle the javascript yourself.
DEFAULTS = {
# You can augment or replace the default set of panel load paths.
# These are the paths where rack-insight will look for panels.
# A rack-insight extension gem could place panels in:
@@ -67,19 +68,21 @@
# Can set a specific verbosity: Rack::Insight::Logging::VERBOSITY[:debug]
:verbosity => @verbosity, # true is equivalent to relying solely on the log level of each logged message
:filtered_backtrace => @filtered_backtrace, # Full back-traces, or filtered ones?
:panel_configs => @panel_configs, # Allow specific panels to have their own configurations, and make it extensible
:silence_magic_insight_warnings => @silence_magic_insight_warnings, # Should Rack::Insight warn when the MagicInsight is used?
- :database => @database # a hash. Keys :raise_encoding_errors, and :raise_decoding_errors are self explanatory
+ :database => @database, # a hash. Keys :raise_encoding_errors, and :raise_decoding_errors are self explanatory
# :raise_encoding_errors
# When set to true, if there is an encoding error (unlikely)
# it will cause a 500 error on your site. !!!WARNING!!!
# :raise_decoding_errors
# The bundled panels should work fine with :raise_decoding_errors set to true or false
# but custom panel implementations may prefer one over the other
# The bundled panels will capture these errors and perform admirably.
# Site won't go down unless a custom panel is not handling the errors well.
+ :handle_javascript => @handle_javascript # If Your setup is AMD, and you are handling your javascript module loading,
+ # including that of jQuery, then you will need to set this to false.
}
@config ||= DEFAULTS
def self.configure &block
yield @config
@@ -96,9 +99,10 @@
@verbosity = Rack::Insight::Config::VERBOSITY[:silent]
end
@filtered_backtrace = config[:filtered_backtrace]
@silence_magic_insight_warnings = config[:silence_magic_insight_warnings]
@database = config[:database]
+ @handle_javascript = !!config[:handle_javascript] # Cast to boolean
config[:panel_configs].each do |panel_name_sym, config|
set_panel_config(panel_name_sym, config)
end