QString m_BoatProgramming("Boat Programming");
qDebug() << m_BoatProgramming;
qDebug() << QDate::currentDate();
Gives me:
"Boat Programming"
"Saturday 20th, 2016"
In some circumstances, rather than going through all the trouble of finding the terminal formatting codes, and manually putting in the metadata, I'd like it to output this:
QString
m_BoatProgramming
:
"Boat Programming"
QDate::currentDate()
:
"Saturday 20th, 2016"
Is this already possible, or do I need to derive a class from qDebug() ?
Yes it'is possible with message handler. Also it's allow you to write message to files of whatever you need.
Here is a modified example from doc to match your requirements:
Will output:
I think with more macro magic or templates you can achieve more convient behaviour.
Note: Be carefull using this macro: in fact exp will be executed twice.