arav
arav

Reputation: 35

Qt debug show line numbers

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

Answers (1)

Chilarai
Chilarai

Reputation: 1888

Please try the following

qDebug() << __FILE__ << __LINE__ << "Your message";

Upvotes: 3

Related Questions