Getting line code from qdebug
-
Wow, I see why you are Area 51 Engineer...
Thank you for this tip.BR,
-
There is a big discussion on that very subject on development mailing list. Here's a link to a pretty much random post (the talk is really long, you'll have to read it anyway to get to know what was decided): "link":http://lists.qt-project.org/pipermail/development/2012-February/001789.html.
Idea is to expand logging a lot more than just the line number.
-
there are a couple of more "standard makros":http://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html to be of use
-
[quote author="sierdzio" date="1328799835"]There is a big discussion on that very subject on development mailing list. Here's a link to a pretty much random post (the talk is really long, you'll have to read it anyway to get to know what was decided): "link":http://lists.qt-project.org/pipermail/development/2012-February/001789.html.
Idea is to expand logging a lot more than just the line number.[/quote]
Thanks for the link - todays bedtime story.
-
I don't think that's possible, as the macro always expands to the current line. But you might use the preprocessor to simulate the behaviour.
@
#define write(msg) writeLine(LINE, msg)void writeLine(int line, QString msg)
{
qDebug() << line << msg;
}...
write("message"); // 9 "message"
@