Class: Lutaml::Model::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/model/services/logger.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.warn(message) ⇒ Object



4
5
6
# File 'lib/lutaml/model/services/logger.rb', line 4

def self.warn(message)
  new.call(message, :warn)
end

.warn_auto_handling(name:, caller_file:, caller_line:) ⇒ Object

Outputs a warning message that

`<name>` is handled by default. No need to explicitly
define at `<caller_file>:<caller_line>`.

Parameters:

  • name (String)
  • caller_file (String)
  • caller_line (Integer)


25
26
27
# File 'lib/lutaml/model/services/logger.rb', line 25

def self.warn_auto_handling(name:, caller_file:, caller_line:)
  warn("`#{name}` is handled by default. No need to explicitly define at `#{caller_file}:#{caller_line}`")
end

.warn_future_deprecation(old:, replacement:) ⇒ Object

Outputs a warning message that

Usage of `old` name is deprecated will be removed in the next major
release. Please use the `replacement`` instead.

Parameters:

  • old: (String)

    The name of the deprecated class or method

  • replacement: (String)

    The name of the replacement class or method



14
15
16
# File 'lib/lutaml/model/services/logger.rb', line 14

def self.warn_future_deprecation(old:, replacement:)
  warn("Usage of `#{old}` is deprecated and will be removed in the next major release. Please use `#{replacement}` instead.")
end

Instance Method Details

#call(message, type) ⇒ Object



29
30
31
# File 'lib/lutaml/model/services/logger.rb', line 29

def call(message, type)
  Warning.warn format_message(message, type)
end