Skip to content
Jean-Michaël Celerier edited this page Jul 3, 2017 · 9 revisions

Procedure

  • Ensure that libossia finds Qt when building :

    cmake ../libossia -DCMAKE_PREFIX_PATH=~/Qt/5.9/gcc_64/lib/cmake/Qt5 -DOSSIA_QT=1

  • make

  • Create a folder Ossia in `~/Qt/5.9/gcc_64/qml/

  • Inside, copy (or better, symlink) the whole content of libossia/OSSIA/ossia-qt/Ossia as well as libossia.so.

Documentation

Logging

Example:

import QtQuick 2.5
import Ossia 1.0 as Ossia

Item {
    Component.onCompleted: {
        // Identify the app
        Ossia.Logger.appName = "MyApp";
       
        // Where will the logger send its messages
        Ossia.Logger.loggerHost = "ws://127.0.0.1:1337";

        // How often the heartbeat will tick, in seconds. 
        // 0 will disable heartbeat.
        Ossia.Logger.heartbeat = 5;

        // Allows redirection of Qt / JS messages going through 
        // console.log / qDebug into websockets.
        Ossia.Logger.logQtMessage = true;

        // Manual logging:
        Ossia.Logger.trace("problem: " + 123);
        Ossia.Logger.info("problem: " + 123);
        Ossia.Logger.debug("problem: " + 123);
        Ossia.Logger.warning("problem: " + 123);
        Ossia.Logger.critical("problem: " + 123);
    }
}
Clone this wiki locally