Enhanced logging with proper script name in logs