This commit adds improved logging for backend plugins in Cura. Now,
each time a plugin is started, an info log is generated with the used
command.
All plugin output will also be logged to a separate file for easier
debugging. Additionally, a cleanup operation has been added to remove
existing plugin logs before generating a new one, to prevent the file
size from getting too large.
Contributes to CURA-11064
This commit introduces logging to the backend plugin process in the Cura application. The output from the plugin process is now redirected to a log file, which is created in the application's data storage directory. This can be useful for debugging and troubleshooting purposes by providing more transparency about what's happening in the plugin process. A new dependency 'os' has been added to the 'BackendPlugin.py'. Also, the 'Resources' module has been imported from 'UM'. The changes mainly affect the way the 'subproccess.Popen' function is used - its 'stdout' and 'stderr' parameters were adjusted accordingly.
Contributes to CURA-11064
Modified BackendPlugin.py and StartSliceJob.py to allow plugins to decide when they should be used. The 'usePlugin'
method was added to enable a plugin to return a boolean indicating if it should be used or not, e.q.: start up and
connect to the services.
Contributes to CURA-11031
Exception handling in BackendPlugin has been improved by adding
user-friendly error messages for various exceptions. Errors during
backend plugin start or stop will now trigger a message to the user,
providing more context about the cause of the failure. This makes it
easier for users to understand and resolve possible issues. In addition,
the EngineBackend stop function has been modified to forcibly stop all
running backend plugins instead of allowing multiple plugins to run
simultaneously.
Any overriding cals that does so, should just add 'self.definition_file_paths' to load their additional settings. However, at the moment of this commit, you should still suppy setting_definitions_appender in the list of __init__.register for the plugin.
part of CURA-10722