Added logging functions.