Add additional logging.

Add additional reformatting and logging code.