Tidy up logging logic and log logic