How and What to Log in a Program