Moved logging functions to a shared util.