Saving code for chapter 7 logging