Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-53063

Debug and Log print no longer working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.6.0
    • Core: I/O
    • None
    • CentOS 7.2.1511 Qt 5.6.0 Qt Creator 3.6.1

    Description

      import QtQuick 2.6
      import QtQuick.Window 2.2
      
      Window {
          visible: true
      
          Text {
              text: qsTr("Hello World")
              anchors.centerIn: parent
      
              Component.onCompleted: {
                  console.warn("warn completed")
                  console.log("log completed")
                  console.error("error completed")
                  console.debug("debug completed")
                  console.exception("exception completed")
                  console.info("info completed")
              }
          }
      }
      
      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      
      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
      
          QQmlApplicationEngine engine;
          engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
      
          return app.exec();
      }
      

      (source: http://stackoverflow.com/questions/36338000/qml-console-log-and-console-debug-dont-write-to-console)

      This used to work in Qt 5.5 (I'm currently on 5.4 due to dbus being broken in 5.5). As reported originally from the user in stackoverflow, debug and log are broken, but the other outputs still work.

      Same affect with qDebug() in C++ being broken. It simply outputs nothing.

      I've also noticed if I put a qDebug() before the initialization of QGuiApplication (or QCoreApplication), it will work. It will NOT work if I attempt to qDebug() immediately after it.

      note I just noticed one other thing. So if I use the prebuilt Qt from the Qt maintenancetool installer, logging DOES work. Therefore this may be less an issue with Qt specifically, and more an issue with how EPEL Release repository packages and compiles Qt?

      qt5-qtbase.x86_64 5.6.0-7.el7 @epel

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            laknoll Lars Knoll
            atemple03 Adam Temple
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes