This should be done like the other optional verbose logging stuff.  @montellese recently added it for json, so that commit is probably a good example.