Often, when I encounter big-O notation during computations, the basis of the logarithm is omitted. Is there an error, or is it in some sense irrelevant? Or am I missing something?
For instance, $\log_2 n$ is often indicated as $O(\log n)$. However, sometimes I also see it as $O(\log_2 n)$ so this is confusing me.
This is due to the property of logarithm's basis.
From the basis change formula of logarithms, you get: $$\log_a n = \frac{\log_b n}{\log_b a} \, $$
and $\log_b a$ is a constant with respect to your variable $n$. Thus, $O(\log_a n)=O(\frac{\log_b n}{\log_b a}) = O(\log_b n)$.
This means that you can either write $O(\log_2 n)$ or omit it and write $O(\log n)$ (which usually refers to the natural basis $e$, also written as $\ln n$), because it makes no difference.