Module: Lich::Common::Log::Preset

Defined in:
lib/common/log.rb

Class Method Summary collapse

Class Method Details

.as(kind, body) ⇒ String

Formats a message as a preset for logging.

Examples:

preset_message = Preset.as(:info, "This is an info message")

Parameters:

  • kind (Symbol)

    the kind of preset

  • body (String)

    the body of the preset

Returns:

  • (String)

    the formatted preset



180
181
182
# File 'lib/common/log.rb', line 180

def self.as(kind, body)
  %[<preset id="#{kind}">#{body}</preset>]
end