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