Add logging functions.