Adds some automatic logging