Forum

Author Topic: Get fail logs from Metashape with python script?  (Read 1903 times)

godszerg

  • Newbie
  • *
  • Posts: 13
    • View Profile
Get fail logs from Metashape with python script?
« on: April 10, 2019, 08:28:18 PM »
Hello!
I was wondering if there is any way to get logs from Metashape if the process failed or terminated with an error or smth like that?
If it's not such a way - how logs are stored in Metashape?
Thanks!

wojtek

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Get fail logs from Metashape with python script?
« Reply #1 on: April 11, 2019, 12:00:46 AM »
You can setup a log file in the preferences of Metashape.

You can also simply write your exception to a file:

log_file = open('C:/error_log.txt','w+')    (use 'a' to append an existing file)
                   
log_file.write("error happened")

log_file.close()