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

timeArgs are not cleared in QMessagePattern::setPattern

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P4: Low P4: Low
    • 5.7.1
    • 5.7.0
    • Core: Other
    • None

      Subsequent calls to qSetMessagePattern with different %{time ...} values will not change the time format in the debug output.
      This happens because the timeArgs list is not cleared alongside literals and tokens in QMessagePattern::setPattern.

      For example:

      void foo() {
      qSetMessagePattern("%{time yyyy} %{message}");
      qDebug() << "NARF";
      qSetMessagePattern("%{time yy} %{message}");
      qDebug() << "ZORT";
      }

      Will produce:

      2016 NARF
      2016 ZORT

      Instead of:

      2016 NARF
      16 ZORT

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

            thiago Thiago Macieira
            paranoid René Küppers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes