Class: Logtail::Integrations::Rack::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/logtail-rack/middleware.rb

Overview

Base class that all Logtail Rack middlewares extend. See the class level methods for configuration options.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



22
23
24
# File 'lib/logtail-rack/middleware.rb', line 22

def initialize(app)
  @app = app
end

Class Method Details

.enabled=(value) ⇒ Object

Easily enable / disable specific middlewares.

Examples:

Logtail::Integrations::Rack::UserContext.enabled = false


12
13
14
# File 'lib/logtail-rack/middleware.rb', line 12

def enabled=(value)
  @enabled = value
end

.enabled?Boolean

Accessor method for #enabled=.

Returns:

  • (Boolean)


17
18
19
# File 'lib/logtail-rack/middleware.rb', line 17

def enabled?
  @enabled != false
end