There are many tricks to be played when generating random numbers from a given distribution with density $f(x)$, ususally cases where you can perform an inverse transform of the primitive analytically, is by far the best.
Say that I cannot calculate this analytically, but I can see that for a given problem it is easily done for $\log(f(x))$, which unfortunately does not lead to a simple transformation rule for $x$, which I would know how to handle. My question is this: Is there a general trick which allows me to generate a number from $\log(f(x))$, and then transform the generated number back to be sampled from the desired distribution?