Moved logging into a utils module so we don't have to duplicate it.