Class: Dry::Logger::Backends::Proxy Private

Inherits:
SimpleDelegator
  • Object
show all
Includes:
Core
Defined in:
lib/dry/logger/backends/proxy.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Logger proxy is used for regular loggers that don’t work with log entries

Since:

  • 1.0.0

Instance Attribute Summary

Attributes included from Core

#log_if

Instance Method Summary collapse

Constructor Details

#initialize(backend, **options) ⇒ Proxy

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Proxy.

Since:

  • 1.0.2



40
41
42
43
44
# File 'lib/dry/logger/backends/proxy.rb', line 40

def initialize(backend, **options)
  super(backend)
  @options = options
  self.log_if = @options[:log_if]
end

Instance Method Details

#log?(entry) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 1.0.0



48
49
50
51
52
53
54
# File 'lib/dry/logger/backends/proxy.rb', line 48

def log?(entry)
  if log_if
    log_if.call(entry)
  else
    true
  end
end