Find the positive integer $n$ for which
$$\left\lfloor\log_2 1\right\rfloor+\left\lfloor\log_2 2\right\rfloor+\left\lfloor\log_2 3\right\rfloor+\cdots+\left\lfloor\log_2 n\right\rfloor=1994.$$
(For real $x$, $\lfloor x\rfloor$ is the greatest integer $\leq x$.)