class Dunlop::LogEntryCreator
  attr_reader :record
  def initialize(record)
    @record = record
  end


  [:debug, :info, :warn, :error].each do |severity|
    define_method(severity) do |msg|
      record.log_entries.create(body: record.logger.formatter.call(severity, Time.current, nil, msg))
    end
  end
end
