Redirect debug output to any ostream.
You can write the debug output to any given ostream. The following example opens a file log and uses it to write its debug output to.
Compile as: g++ -DCWDEBUG log_file.cc -lcwd -o log_file
Debug code like the definition of the debug file file, should be put between #ifdef CWDEBUG ... #endif as usual. This isn't needed for Debug() or Dout() because these macros are automatically replaced with white space when CWDEBUG is not defined.
Continue with Tutorial 4: Management Of CWDEBUG.