Method: Logging::Layouts::Pattern.create_format_method

Defined in:
lib/logging/layouts/pattern.rb

.create_format_method(pl) ⇒ Object

call-seq:

Pattern.create_format_method( pl )

This method will create the ‘format` method in the given Pattern Layout `pl` based on the configured format pattern specified by the user.



190
191
192
193
194
195
196
197
# File 'lib/logging/layouts/pattern.rb', line 190

def self.create_format_method( pl )
  builder = FormatMethodBuilder.new(pl)
  code = builder.build_code

  ::Logging.log_internal(0) { code }

  pl._meta_eval(code, __FILE__, __LINE__)
end