Module: LightService::Deprecation

Defined in:
lib/light-service/deprecation_warning.rb

Class Method Summary collapse

Class Method Details

.warn(message, callstack = caller) ⇒ Object

:nocov: Basic implementation of a deprecation warning



6
7
8
9
10
11
12
13
14
15
# File 'lib/light-service/deprecation_warning.rb', line 6

def warn(message, callstack = caller)
  # Construct the warning message
  warning_message = "DEPRECATION WARNING: #{message}\n"
  warning_message += "Called from: #{callstack.first}\n" unless callstack.empty?

  # Output the warning message to stderr or a log file
  warn warning_message

  # Additional logging or actions can be added here
end