Improved logging for wait.sh script