How to keep a failure log, and why this is the key to happiness