For starters, you need to remember the logarithm law
 } = p\log_b{(m)} \end{align*})
. So if you start with your equation

and take a logarithm of ANY base to both sides (in this case they chose 3 because it cancels easiest on the left hand side), we have
It would have been just as easy to cancel on the RHS by taking both sides to a base 10 logarithm, or even taking both sides to any other logarithm as well.
Most logarithm values are transcendental, unless the number you are taking a logarithm of is a power of the same base of your logarithm, because then you have natural cancellation. If your logarithm is transcendental though, decimal approximations can be made using a Taylor Series (which calculators would be programmed with).