How to debug plugins?

I’ve used the Plog class to write log messages, but what are the other options for plugin debugging? Can we use a debugger?

Particularly when jami does not launch anymore, probably because of plugins conflict or a plugin error. How to find the cause of the error? What can be done to restore a running jami?

Hello,

There are two ways you can debug plugins: in jami itself (using logs) or using a runnable plugin build (where you will be able to debug with breakpoints and all). We recently added this second test for AutoAnswer, AudioFilter, WaterMark and GreenScreen.

If you installed a faulty plugin and because of it now you cannot launch jami. you can manually remove it in two steps:
1 - In ~/.config/jami/dring.yml replace

  installedPlugins:
    - <installed_plugin>
    - <installed_plugin>
  loadedPlugins:
    - <loaded_plugin>
    - <loaded_plugin>

with

  installedPlugins:
    []
  loadedPlugins:
    []

2 - remove directory ~/.local/share/jami/plugins

Hello @agsantos,

Can you be a bit more explicit?

I’ve seen that AutoAnswer can be built into a standalone executable to run some tests but how do you define __DEBUG__ in the build process?

I did not found such tests for the other plugins. But I found the TestSuite plugin whose usage is not obvious. How does it help testing plugins?

Thanks for pointers and more hints.

Hi,

the TestSuite is a non user directed plugin. It is meant to be used on daemon unit tests.

For AutoAnswer, AudioFilter, WaterMark and GreenScreen, you can build their standalone versions with ./build.sh -d . In their main.cpp file you can find the main function that will trigger the plugin process.
You don’t need to manually set __DEBUG__ as the build script should handle it.

If you are using windows, all you need to do is change the plugin package.json file to set TESTPROCESS=True.