Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Changing debug log level
Forum Updated to NodeBB v4.3 + New Features

Changing debug log level

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 6.9k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pderocco
    wrote on last edited by
    #1

    Is there any way, preferably from QML, to change the debug log level to suppress harmless warnings? I've got some QML GridLayout stuff that complains about cells already being taken, and they're cluttering up the log when I'm trying to use the log for my own debugging.

    (FYI, GridLayout objects have a particular limitation when dealing with items that span multiple cells, which I was only able to work around by overlapping them with dummy items. So I can't accomplish the formatting I need without provoking these harmless but annoying warnings.)

    KazuoAsanoK 1 Reply Last reply
    0
    • sierdzioS sierdzio

      See logging category docs.

      P Offline
      P Offline
      pderocco
      wrote on last edited by pderocco
      #4

      @sierdzio Thanks. Using this in main.cpp:

      QLoggingCategory::setFilterRules("*.warning=false");

      suppresses the warnings, but allows my console.log stuff to come through. I'd like to be more specific, but it appears that qgridlayoutengine.cpp uses QWarning(), which implies the "default" category, so even if I change the wildcard to "default", it's probably still going to filter out most warnings I might get in the future. I wish there was a way to install a regex filter on the log output.

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #2

        See logging category docs.

        (Z(:^

        P 1 Reply Last reply
        5
        • P pderocco

          Is there any way, preferably from QML, to change the debug log level to suppress harmless warnings? I've got some QML GridLayout stuff that complains about cells already being taken, and they're cluttering up the log when I'm trying to use the log for my own debugging.

          (FYI, GridLayout objects have a particular limitation when dealing with items that span multiple cells, which I was only able to work around by overlapping them with dummy items. So I can't accomplish the formatting I need without provoking these harmless but annoying warnings.)

          KazuoAsanoK Offline
          KazuoAsanoK Offline
          KazuoAsano
          Qt Champions 2018
          wrote on last edited by
          #3

          @pderocco ,

          I think that only QML can't stop warning from library.
          In mixed C ++ and QML project case, it may be stop by adding QT_NO_WARNING_OUTPUT at CONFIG.
          http://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages

          and additional information, I use original log output at "LoggingCategory QML Type" in QML.
          https://doc.qt.io/qt-5/qml-qtqml-loggingcategory.html

          1 Reply Last reply
          1
          • sierdzioS sierdzio

            See logging category docs.

            P Offline
            P Offline
            pderocco
            wrote on last edited by pderocco
            #4

            @sierdzio Thanks. Using this in main.cpp:

            QLoggingCategory::setFilterRules("*.warning=false");

            suppresses the warnings, but allows my console.log stuff to come through. I'd like to be more specific, but it appears that qgridlayoutengine.cpp uses QWarning(), which implies the "default" category, so even if I change the wildcard to "default", it's probably still going to filter out most warnings I might get in the future. I wish there was a way to install a regex filter on the log output.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #5

              You can install your own filter (see next section under my link), but that will be cumbersome.

              Or you can patch your Qt sources and insert a logging category in that file, then filter it out.

              It would also be good to fix this upstream - feel invited to open a bug report for last of category in layout engine.

              (Z(:^

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved