Reputation: 35
I am a newbie programmer. Is there any way that I can print the File name and line number of my qDebug()
output in Qt C++ code?
Currently, I have to manually write the filename every time I output a debug message.
Please help
Upvotes: 2
Views: 911
Reputation: 1888
Please try the following
qDebug() << __FILE__ << __LINE__ << "Your message";
Upvotes: 3