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

QMessageLogger ignores filter rules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.15.2
    • Core: Other
    • None
    • All

    Description

      It seems that QMessageLogger does ignore any filter rule set with QLoggingCategory::setFilterRules(...).

      We use different logging categories for different modules. Furthermore we have several methods which are called "from" multiple categories. These methods receive a QMessageLogger as argument so we may log the function, file, and line number of the caller not of the method which outputs to the QMessageLogger.

      In this situation any filter rules are ignored and the output is written even if the specific category was disabled.

      See the attached minimal example for a more tangible explanation of what we are going for.
      It also includes a very simple workaround wrapper which considers the filter rules.

      Attachments

        1. CMakeLists.txt
          0.5 kB
        2. main.cpp
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            janmoeller Jan Möller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes