Re: mooooooooooore debug messages
Posted by
dxli on
Jul 16, 2013; 4:31pm
URL: https://forum.librecad.org/mooooooooooore-debug-messages-tp5708530p5708576.html
Hi,
I don't quite get what you want to achieve here.
if you mean:
#define DBG(a) std::cerr << a; //<--- this is the new line I wanted to be added
parsing argv[] is carried out at running time, and parsing C style macros is carried out at cpp building time.
Also, macros are not limited by scope, so the macros would be visible for lines thereafter, the if() and {} have no effect here.
Thanks,
dxli
On Tue, Jul 16, 2013 at 11:55 AM, cantcode [via LibreCAD]
<[hidden email]> wrote:
Is it a bad idea to change
for (int i=0; i<argc; i++) {
if (QString("--debug") == argv[i]) {
RS_DEBUG->setLevel(RS_Debug::D_DEBUGGING);
}
}
to
for (int i=0; i<argc; i++) {
if (QString("--debug") == argv[i]) {
RS_DEBUG->setLevel(RS_Debug::D_DEBUGGING);
define DBG(a) std::cerr << a; //<--- this is the new line I wanted to be added
}
}
?
--
Dongxu Li, Ph.D.
www.librecad.org