Change debug messages to use the log() function.