Linked by Eugenia Loli on Mon 2nd Feb 2004 07:00 UTC
General Development Every C++ program -- and every networking app -- needs a good logging mechanism. ACE provides you with more than one way to handle such things. Consider your application and how you expect it to grow over time. Your choices range from the simple ACE_DEBUG macros to the highly flexible logging service. Regarding .NET, exception handling is more than just throwing and catching objects. There are many design elements in providing a robust system, and providing a sound exception handling, logging, and tracing schema are among the first steps. In this chapter from ".NET Patterns: Architecture, Design, and Process" book, you'll learn best practices for determining when to throw, catch, and log your errors.
Permalink for comment
To read all comments associated with this story, please click here.

From the first page
"However, an important factor in the logging facility's design is the ability to effectively "no-op" the logging statements at compile time."

Note that a stream based compile time on/off method works easily

// in header
#ifdef NDEBUG
#define MY_DEBUG if( 0 ) cerr
#else
#define MY_DEBUG if( should_runtime_show() )
get_real_stream_reference();
else
get_null_stream_reference();
#endif

// in program
MY_DEBUG << "foo" << endl;