DebugTools using a log file to debug plugins
As i could'nt use console.log for monts i needed to have a new output.
So i created this component to output in a log file.
The better place for a plugin log file is the plugin directory itself,
So i use the current directory /documents/musescore4/plugins/myplugin (to avoid hard expression i gain that directory by code.
Usage :
in modele.qml (my plugin example)
DebugTools
{// One instancie of the tool
id : debugTools
pluginName: "Modele"
}
Component.onCompleted:
{// The plugin modele is loaded
}
onRun:
{// Check pre-conditions
debugTools.appendLog("It runs ...");
if (!preConditions())
{
rBarreOutils.enabled = false;
rBarreBoutons.enabled = false;
debugTools.appendLog("Pre-conditions failed !!!");
}
debugTools.appendLog("bla bla bla");
}
API compatibility
4.x
Upload
Attachment | Size |
---|---|
DebugTools.qml | 2.84 KB |