4. Let the function $f(x)=\cos x+\log _{2} x(x>0)$, if the positive real number $a$ satisfies $f(a)=f(2 a)$, then the value of $f(2 a)-f(4 a)$ is $\qquad$ .
$$
\begin{array}{l}
\cos a+\log _{2} a=\cos 2 a+\log _{2} 2 a=\cos 2 a+1+\log _{2} a \Rightarrow \cos a=\cos 2 a+1 \\
=2 \cos ^{2} a \Rightarrow \cos a=0 \text { or } \frac{1}{2} . \text { Therefore, } f(2 a)-f(4 a)=\cos 2 a-\cos 4 a-1 \\
=\cos 2 a-2 \cos ^{2} 2 a=-3 \text { or }-1 .
\end{array}
$$