The textbook is precisely correct. The equilibrium constant $K$ which the logarithm is taken of is dimentionless, and includes activities or fugacities, and not concentrations and pressures. In practice this is achieved by using standard states which refer to the pure materials: standard concentration $c^⦵$ and standard pressure $p^⦵$. One must be very fastidious with units when finding the equilibrium constant. For example, the reaction
$$\ce{aA + bB <=> cC + dD}$$
equilibrium constant $K_c$ is exactly
$$K_c = \frac{([\ce{C}]/c^⦵)^c\cdot ([\ce{D}]/c^⦵)^d}{([\ce{A}]/c^⦵)^a\cdot ([\ce{B}]/c^⦵)^b}$$
For pure water in its standard state $c^⦵ = [\ce{H+}] = \pu{1e-7 M}$. It also correlates with so-called biological standard state of $\mathrm{pH} = 7$. You probably haven't seen it before because many authors use sloppy notations omitting mentioning standard states since they can often be cancelled out. In this case those cannot be cancelled out, and must be written explicitly.