Document logging

(There seem to be a few small commits unrelated to logs in here too -- sorry about that. My git-fu isn't quite strong enough to weed them out)