w_debug.h File Reference


Detailed Description

This is a set of macros for use with C or C++. They give various levels of debugging printing when compiled with --enable-trace. With tracing, message printing is under the control of an environment variable DEBUG_FLAGS (see debug.cpp). If that variable is set, its value must be a string. The string is searched for __FILE__ and the function name in which the debugging message occurs. If either one appears in the string (value of the env variable), or if the string contains the word "all", the message is printed.

DUMP(x) prints x (along with line & file) if "x" is found in debug environment variable

FUNC(fname) DUMPs the function name. RETURN prints that the function named by __func__ is returning This macro MUST appear within braces if used after "if", "else", "while", etc.

DBG(arg) prints line & file and the message arg if __func__ appears in the debug environment variable. The argument must be the innermost part of legit C++ print statement, and it works ONLY in C++ sources.

Example :

    returntype
    proc(args)
    {
        FUNC(proc);
       ....body...

       DBG(
          << "message" << value
          << "more message";
          if(test) {
             cerr << "xyz";
          }
          cerr
       )

       ....more body...
       if(predicate) {
           RETURN value;
        }
    }

DUMP, FUNC, and RETURN macros' definitions depend on how the storage manager is configured. They don't do a lot unless configured with --enable-trace

Definition in file w_debug.h.

Go to the source code of this file.

Classes

class  w_debug
 An ErrLog used for tracing (configure --enable-trace). More...

Defines

#define DUMP(str)
#define FUNC(fn)
#define RETURN   return
#define DBG(a)
#define DBGTHRD(arg)   DBG(<<" th."<<sthread_t::me()->id << " " arg)

Typedefs

typedef ios::fmtflags w_dbg_fmtflags


Generated on Wed Jul 7 17:22:32 2010 for Shore Storage Manager by  doxygen 1.4.7