[ADIC] #40: replace debugMsg with a nice macro
#40: replace debugMsg with a nice macro -------------------------+-------------------------------------------------- Reporter: utke | Owner: Type: enhancement | Status: new Priority: major | Milestone: Component: Utilities | Version: Keywords: | -------------------------+-------------------------------------------------- one of the few things that macros are good for... part of the problem is stuff like this: debugMsg(5, "FILE : " + sg->unparseToString()); The argument "FILE : " + sg->unparseToString() is ALWAYS evaluated regardless of the debug level I specify on the command line. If you replace this with a nice macro like the openad/f one: #define DBG_TAG_MACRO(Group,Tag,StreamArgs) \ if (DbgLoggerManager::instance()->isSelected((Group)) && DbgLoggerManager::instance()->wantTag((Tag))) { \ std::ostringstream aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy; \ aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy << StreamArgs << std::ends; \ DbgLoggerManager::instance()->logDebug(__FILE__,__LINE__,(Group),aLoNgAnDwEiRdLoCaLnAmeFoRtHiSmAcRoOnLy,(Tag)); \ } you not only avoid evaluating the arguments but also get automatically __FILE__ and __LINE__ injected. Wouldn't that be nice? -- Ticket URL: <http://trac.mcs.anl.gov/projects/ADIC/ticket/40> ADIC <http://trac.mcs.anl.gov/projects/ADIC> ADIC: Automatic Differentiation for C and C++
#40: replace debugMsg with a nice macro -------------------------+-------------------------------------------------- Reporter: utke | Owner: Type: enhancement | Status: new Priority: major | Milestone: Component: Utilities | Version: Keywords: | -------------------------+-------------------------------------------------- Comment(by norris): Feel free to do that if you want -- given that it's a hugely pervasive change and not on the critical path for C/C++ (and a lot of other things are), I don't think it's high priority for ADIC. -- Ticket URL: <http://trac.mcs.anl.gov/projects/ADIC/ticket/40#comment:1> ADIC <http://trac.mcs.anl.gov/projects/ADIC> ADIC: Automatic Differentiation for C and C++
#40: replace debugMsg with a nice macro --------------------------+------------------------------------------------- Reporter: utke | Owner: Type: enhancement | Status: closed Priority: major | Milestone: Component: Utilities | Version: Resolution: fixed | Keywords: --------------------------+------------------------------------------------- Changes (by snarayan): * status: new => closed * resolution: => fixed -- Ticket URL: <http://trac.mcs.anl.gov/projects/ADIC/ticket/40#comment:2> ADIC <http://trac.mcs.anl.gov/projects/ADIC> ADIC: Automatic Differentiation for C and C++
participants (1)
-
ADIC