For most sources of radiation, there are two factors that diminish the power with distance. The first of these is the inverse square law, which tells us that every time we double the distance to the source, the power per unit area drops by a factor of 4. This makes sense from the perspective of conservation of energy - the sum (integral) of energy over all directions must be constant.
But there is a second factor that becomes more important at large distances, and that is absorption. While the inverse square law assumes no losses along the path of the radiation, that is not the case in the real world. Attenuation follows an exponential law, and at sufficiently large distances from the source, attenuation will dominate the calculation and lead to an exponential drop off of source intensity with distance.
For the case of WiFi signals, the attenuation in air is small (but the attenuation in walls etc. is substantial). The equation you quote is for the dB power level ignoring attenuation. If I have
$$P \propto \frac{1}{r^2}$$
then on a dB scale,
$$\log(p/p_0) = -2 \log(r/r_0) $$
Where $p_0$ and $r_0$ are the reference power at reference distance.
Note that is NOT a $\frac{1}{\log(r)}$ relationship ... that makes no sense at all (and is demonstrably wrong, even for a dB scale).
UPDATE:
Reading this answer again a few years later, I now see that it's possible that the equation the OP was shown (and possibly misremembered) included
$$\log{P} \propto P_{dB} \propto \log{\frac{1}{r}}$$
Power in decibels does indeed scale with the log of the inverse of distance (but not the inverse of the log of the distance...). Note that whether it's distance or distance squared just changes the constant of proportionality in log space...