Logging

I'm opening this pull request to make it easier to see what is on the logging branch.  It is not yet ready to merge.