adding logging around cached versions of functions