Improve logging of phase-writer scritp