Module: LogStruct::Integrations::CarrierWave

Extended by:
IntegrationInterface, T::Sig
Defined in:
lib/log_struct/integrations/carrierwave.rb

Overview

CarrierWave integration for structured logging

Defined Under Namespace

Modules: LoggingMethods

Class Method Summary collapse

Methods included from IntegrationInterface

setup

Class Method Details

.setup(config) ⇒ Boolean?

Set up CarrierWave structured logging

Parameters:

Returns:

  • (Boolean, nil)


19
20
21
22
23
24
25
26
27
28
# File 'lib/log_struct/integrations/carrierwave.rb', line 19

def self.setup(config)
  return nil unless defined?(::CarrierWave)
  return nil unless config.enabled
  return nil unless config.integrations.enable_carrierwave

  # Patch CarrierWave to add logging
  ::CarrierWave::Uploader::Base.prepend(LoggingMethods)

  true
end