Hello Christina,
For example, if you are using Windows, you can re-direct the log output in the following way:
metashape.exe -r "D:/script.py" > "D:/log.txt" 2>&1
It will save both common and error output streams to the same file.
As for the error specifics, "Zero Resolution" could mean that the bounding box does not include the area of interest. If you are optimizing the alignment prior to the dense cloud generation, I can suggest to use resetRegion() function after optimization is completed.