How can the definition of the pH value $\mathrm{pH}=-\log\left[\ce{H+}\right]$ yield a unitless result? Since $\left[\ce{H+}\right]$ is a concentration, wouldn't it have units $\mathrm{mol/dm^3}$ and therefore following the product rule you would get: $-\log\left(x\ \mathrm{mol/dm^3}\right)=-\log\left(x\right)-\log\left(\mathrm{mol/dm^3}\right)$.
How can these units in a mathematical sense suddenly disappear?