Add debugging code to log to stdout.