def log(type, str)
      case type
      when :connect
        @logger << Colors.green(str)
      when :close
        @logger << Colors.red(str)
      when :read
        @logger << Colors.gold(str)
      when :write
        @logger << Colors.white(str)
      else
        raise "unknown event type: #{type.inspect}"
      end
    end
def log(type, str)
      case type
      when :connect
        @logger << Colors.green(str)
      when :close
        @logger << Colors.red(str)
      when :read
        @logger << Colors.gold(str)
      when :write
        @logger << Colors.white(str)
      else
        raise "unknown event type: #{type.inspect}"
      end
    end
Log the given event