[Solved] QML console.log is not showing

Hi :waving_hand:

I want to debug some values in the QML file GPSIndicatorPage.qml, let’s take for example the AutoConnect check box.

I use this function to debug :

function myFunction() {
    console.log("myFunction was called, my value is now ...")
}

And add it to my button I want to debug :

FactCheckBoxSlider {
    Layout.fillWidth:   true
    text:               qsTr("AutoConnect")
    fact:               QGroundControl.settingsManager.autoConnectSettings.autoConnectRTKGPS
    visible: {
        myFunction()
        fact.visible
    }
    
    // onValueChanged: myFunction() // Not a correct parameters for FactCheckBoxSlider
    // onClicked: myFunction() // Same
}

But nothing is shown in the consol :
I have tried :

  • change console.log to console.error
  • export QT_LOGGING_RULES=“.debug=true; qt..debug=false”
  • remove /home/lmx/.config/QGroundControl.org/
  • redirect str_err to std_out : ./build/AppDir/AppRun 2>&1
  • make a small app in cpp, it’s correclty printing the message

Do you have a hint ? Thanks !

The error came from an error on my part in another file, so compilation was interrupted and the file with the debug is not updated.

No additional parameters needed to be used. I’ve commented on the code in the first post for those who might be interested.
In any case, don’t hesitate to make a small visible change to make sure you’re working on the new version of the file. :smiley: