Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.7.0
-
None
Description
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
Attachments
For Gerrit Dashboard: QTBUG-57144 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
176749,2 | Make sure all pattern args get cleared when parsing a new pattern | 5.7 | qt/qtbase | Status: MERGED | +2 | 0 |