Module: Debugbar

Includes:
Tracker
Defined in:
lib/debugbar/middlewares/quiet_routes.rb,
lib/debugbar.rb,
lib/debugbar/config.rb,
lib/debugbar/engine.rb,
lib/debugbar/current.rb,
lib/debugbar/request.rb,
lib/debugbar/version.rb,
lib/debugbar/http/http.rb,
lib/debugbar/buffers/null_buffer.rb,
lib/debugbar/loggers/http_logger.rb,
lib/debugbar/buffers/cache_buffer.rb,
lib/debugbar/buffers/memory_buffer.rb,
lib/debugbar/loggers/simple_logger.rb,
lib/debugbar/buffers/request_buffer.rb,
lib/debugbar/subscribers/active_job.rb,
app/channels/debugbar/debugbar_channel.rb,
app/models/debugbar/application_record.rb,
lib/debugbar/subscribers/active_record.rb,
lib/debugbar/subscribers/active_support.rb,
app/controllers/debugbar/assets_controller.rb,
lib/debugbar/subscribers/action_controller.rb,
app/controllers/debugbar/polling_controller.rb,
lib/debugbar/middlewares/track_current_request.rb,
app/controllers/debugbar/application_controller.rb

Overview

This middleware silences the Rails logger for requests to the Debugbar routes. The poll route can be very noisy. Rails already does this for the /assets route, see Sprockets::Rails::QuietAssets.

See Also:

  • Sprockets::Rails::QuietAssets
  • Rails::Rack::Logger#silence

Defined Under Namespace

Modules: TagHelpers, Tracker Classes: ActionControllerEventSubscriber, ActiveJobEventSubscriber, ActiveRecordEventSubscriber, ActiveSupportEventSubscriber, ApplicationController, ApplicationRecord, AssetsController, CacheBuffer, Config, Current, DebugbarChannel, Engine, HttpLogger, HttpRequest, HttpResponse, MemoryBuffer, NullBuffer, PollingController, QuietRoutes, Request, RequestBuffer, SimpleLogger, TrackCurrentRequest

Constant Summary collapse

TIME_FORMAT =
"%H:%M:%S.%L"
VERSION =
"0.4.2"

Constants included from Tracker

Tracker::METHODS, Tracker::SETTERS

Class Method Summary collapse

Class Method Details

.configObject



67
68
69
# File 'lib/debugbar.rb', line 67

def config
  @config ||= Config.new(enabled: true)
end

.configure {|config| ... } ⇒ Object

Yields:



71
72
73
# File 'lib/debugbar.rb', line 71

def configure
  yield config
end

.msg(msg, *extra) ⇒ Object



75
76
77
78
# File 'lib/debugbar.rb', line 75

def msg(msg, *extra)
  source = caller.first&.split(":in")&.map { |s| s.delete_prefix("#{Rails.root}/").strip.tr("`'", '' ) }
  Tracker.msg(msg, extra, source)
end