Refactor SAS logging