Forum

Author Topic: Recording logs and console output using Python  (Read 3539 times)

Wizyza

  • Newbie
  • *
  • Posts: 26
    • View Profile
Recording logs and console output using Python
« on: October 23, 2023, 07:54:50 PM »
Hello,

I'm running into some unwanted behavior when saving log/console output when running a script from within the GUI.

I have my script set up to enable logging at the start of the script. I then disable logging in the last line of my script so Metashape does not write to the previous log file the next time the application starts up. However, doing this seemingly prevents the last few lines of the console output from being recorded.

I figured a way around this would be to save the entire console text (Metashape.app.console_pane_contents) after the rest of the script has executed. However, I can't figure out how to do this through Python scripting. I want to save the output as a TXT file.

Thanks!