module Logtail::Integration

An integration represent an integration for an entire library. For example, `Rack`. While the Logtail `Rack` integration is comprised of multiple middlewares, the `Logtail::Integrations::Rack` module is an entire integration that extends this module.

Public Instance Methods

enabled=(value) click to toggle source

Easily sisable entire library integrations. This is like removing the code from Logtail. It will not touch this library and the library will function as it would without Logtail.

@example

Logtail::Integrations::ActiveRecord.enabled = false
# File lib/logtail/integration.rb, line 12
def enabled=(value)
  @enabled = value
end
enabled?() click to toggle source

Accessor method for {#enabled=}

# File lib/logtail/integration.rb, line 17
def enabled?
  @enabled != false
end
integrate!() click to toggle source

Abstract method that each integration must implement.

# File lib/logtail/integration.rb, line 36
def integrate!
  raise NotImplementedError.new
end
silence=(value) click to toggle source

Silences a library's logs. This ensures that logs are not generated at all from this library.

@example

Logtail::Integrations::ActiveRecord.silence = true
# File lib/logtail/integration.rb, line 26
def silence=(value)
  @silence = value
end
silence?() click to toggle source

Accessor method for {#silence=}

# File lib/logtail/integration.rb, line 31
def silence?
  @silence == true
end