Hey
I'm a bit stuck at the moment, I'm trying to route Agisofts own stdout to a log. A bit of background first....
I've got a XML batch script which gets invoked on Deadline. Metashape gets called with the -platform offscreen argument, the xml with -xml argument, and the Python file called batch_runner.py with the -r argument.
The batch _runner.py gets invoked for each xml of our pipeline. Each xml contains details for running multiple Python nodes like (ImportPhotos.py or Align.py).
The batch_runner.py currently parses the XML to find script paths and args, and then calls run_script method for each, to run the proper Python module.
In the batch_runner.py file at the bottom in __init__, I switch the stdout to my own object, that can write out to a log.
if __init__ == "__main__":
# .... other code lines
# Keep the old stdout
sys._stdout = sys.stdout
# Route stdout to my own log file
sys.stdout = logger_write_continually.LoggerWriteContinually(log_file_path)
# Run all the tasks of XML batch file using custom Python object
AgisoftBatchRunner(args)
# Restore original stdout
sys.stdout = sys._stdout
The problem is this only captures messages that I "print" within the called Python modules (like Align.py).
It doesn't include the exhaustive Metashape messages, about what's happening under the hood.
Is there anyway to route all stdout, my own and Agisofts to a log file?
Thanks
Braden