Class: DeprecationHelper::Strategies::LogError

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
BaseStrategyInterface
Defined in:
lib/deprecation_helper/strategies/log_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger: nil) ⇒ LogError

Returns a new instance of LogError.



11
12
13
# File 'lib/deprecation_helper/strategies/log_error.rb', line 11

def initialize(logger: nil)
  @logger = T.let(logger || Logger.new(STDOUT), T.untyped)
end

Instance Method Details

#apply!(message, backtrace) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



16
17
18
# File 'lib/deprecation_helper/strategies/log_error.rb', line 16

def apply!(message, backtrace) # rubocop:disable Lint/UnusedMethodArgument
  @logger.warn(message)
end