Hi,
You can create an error file and use the sys pipeline to get runtime feedback. Obviously you'll want to delete this code after the plug-in is stable and finished. You can put the code anywhere in your plug-in. I like to put the code at the beginning of the plug-in.
It's not entirely necessary to close the error file, but I've had trouble with it closing with certain errors. Try closing the file before exiting the plug-in.
I don't know your coding experience, but VS Code will help you catch frustrating errors and teach useful code habbits.
You can create an error file and use the sys pipeline to get runtime feedback. Obviously you'll want to delete this code after the plug-in is stable and finished. You can put the code anywhere in your plug-in. I like to put the code at the beginning of the plug-in.
Code:
# _______________________________________________________________
# Open an error file. It will capture error output.
# The file will also take 'print' output.
import time # noqa
error_file = sys.stdout = sys.stderr = open("C:\\error.txt", 'a')
print("\nStart debug,", time.ctime(), "_" * 30, "\n")
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
It's not entirely necessary to close the error file, but I've had trouble with it closing with certain errors. Try closing the file before exiting the plug-in.
Code:
# This is better than letting the OS close the file.
error_file.close()
I don't know your coding experience, but VS Code will help you catch frustrating errors and teach useful code habbits.