Qt Quick uses qDebug to perform logging, where the standard Javascript logging methods are maped to a Qt log type
console.log() -> qDebug()
console.debug() -> qDebug()
console.info() -> qDebug()
console.warn() -> qWarning()
console.error() -> qCritical()
At this point you loose the distinction between debug() and info().
Is there any way to register a custom logger for the Javascript methods directly in the QML engine without going over qDebug and qInstallMessageHandler?
Although the globalObject is read-only in the QQmlEngine, values stored therein are not. So you can modify the console property of the globalObject. You can do that both in C++ and in QML. Here is a trivial running example in QML:
The first two buttons change, what the third button does by modifying the console.log method. C++ would look something like this (I cannot copy all of my code here, sorry, but it should get you going and it works nicely):