def to_s(filter = nil, version = nil)
      v = send(version) if version
      v = (v && v != DEFAULT_VERSION) ? " v#{v}" : ""
      log_msg = "[#{name}#{v}]"
      duration = if @duration && (filter.nil? || filter.include?(:duration))
        ", #{enough_precision(@duration)} sec"
      elsif @received_at && (filter.nil? || filter.include?(:local_duration))
        ", #{enough_precision(Time.now.to_f - @received_at)} sec"
      end
      log_msg += " (#{@size.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,")} bytes#{duration})" if @size && !@size.to_s.empty?
      log_msg
    end
def to_s(filter = nil, version = nil)
      v = send(version) if version
      v = (v && v != DEFAULT_VERSION) ? " v#{v}" : ""
      log_msg = "[#{name}#{v}]"
      duration = if @duration && (filter.nil? || filter.include?(:duration))
        ", #{enough_precision(@duration)} sec"
      elsif @received_at && (filter.nil? || filter.include?(:local_duration))
        ", #{enough_precision(Time.now.to_f - @received_at)} sec"
      end
      log_msg += " (#{@size.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,")} bytes#{duration})" if @size && !@size.to_s.empty?
      log_msg
    end
Generate log representation

 === Parameters
 filter(Array(Symbol)):: Attributes to be included in output
 version(Symbol|nil):: Version to display: :recv_version, :send_version, or nil meaning none

 === Return
 log_msg(String):: Log representation