Forum

Author Topic: Redirecting the console output  (Read 1053 times)

Hugh

  • Newbie
  • *
  • Posts: 19
    • View Profile
Redirecting the console output
« on: March 30, 2022, 09:18:57 PM »
Is it possible to redirect the output in Python when using the Metashape python module? Ideally I'd like to be able to hook into it another way, although as I can set Metashape.app.settings.log_path, an alternate solution would be to only have it log to the file and stop output to stdout.

For readability in the terminal, I'd like to just deal with the output myself using the progress callback, and have the raw log go to a file (ideally with timestamps, which is why I was hoping I could redirect it)

If I were running a script with metashape.exe -r, I could redirect the output using the subprocess module, but I'm not sure how I could do this when using the Metashape module directly.

Thanks