class Lumberjack::Formatter::DateTimeFormatter

it will use the ISO-8601 format.
Format a Date, Time, or DateTime object. If you don’t specify a format in the constructor,

def call(obj)

def call(obj)
  if @format && obj.respond_to?(:strftime)
    obj.strftime(@format)
  elsif obj.respond_to?(:iso8601)
    obj.iso8601
  else
    obj.to_s
  end
end

def initialize(format = nil)

Parameters:
  • format (String) -- The format to use when formatting the date/time object.
def initialize(format = nil)
  @format = format.dup.to_s.freeze unless format.nil?
end