Le mercredi 23 novembre 2011 à 04:06:11, tedfe...@users.sourceforge.net a 
écrit :
>Revision: 12706
>         
>http://rosegarden.svn.sourceforge.net/rosegarden/?rev=12706&view=rev
>Author:   tedfelix
>Date:     2011-11-23 03:06:10 +0000 (Wed, 23 Nov 2011)
>Log Message:
>-----------
>Just some mindless cleanup.  Mostly replacing RG_DEBUG for std::cerr.
>No functional changes.
>

Are you sure std::cerr is not sometimes better than RG_DEBUG ?

>
>-    std::cerr << "Composition::getTrackById("
>+    RG_DEBUG << "Composition::getTrackById("
>             << track << ") - WARNING - track id not found, this is probably a
>BUG " -              << __FILE__ << ":" << __LINE__ << std::endl;
>-    std::cerr << "Available track ids are: " << std::endl;
>+            << __FILE__ << ":" << __LINE__;
>+    RG_DEBUG << "Available track ids are: ";
>     for (trackconstiterator i = m_tracks.begin(); i != m_tracks.end(); ++i)
>{ -    std::cerr << (int)(*i).second->getId() << std::endl;
>+        RG_DEBUG << (int)(*i).second->getId();
>     }

Here, for example, some abnormal event occurs and a warning is printed.
This works with std::cerr and is intended to show the warning while using RG 
normally, without debugging.
With RG_DEBUG, the warning will be lost inside a huge pile of messages.
Moreover we will never get the message when a problem occurs while a normal 
user is working with RG.


> //#define DEBUG_BAR_STUFF 1
> //#define DEBUG_TEMPO_STUFF 1

>
> #ifdef DEBUG_BAR_STUFF
>-    cerr << "Composition::calculateBarPositions" << endl;
>+    RG_DEBUG << "Composition::calculateBarPositions";
> #endif
>

And here the #ifdef controls the print instruction.
Probably because the developper who wrote it was debugging without being in 
the "debug mode" and just commented/uncommented the #define to got the messages 
he wanted without having them lost in the whole debug flow.

Yves



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to