Better logging in both normal and debug modes