1 // $Header: x:/prj/tech/libsrc/lg/RCS/dbgpp.h 1.5 1996/10/10 12:11:38 TOML Exp $
3 // Revision 1.5 1996/10/10 12:11:38 TOML
6 // Revision 1.4 1996/01/24 10:48:59 DAVET
7 // Added cplusplus stuff
9 // Revision 1.3 1995/03/15 22:27:15 ept
10 // Added Errorpp and WarnUserpp to things defined when DBG_ON not set.
12 // Revision 1.2 1994/12/06 22:39:46 lmfeeney
13 // correct args for Errorpp
15 // Revision 1.1 1994/08/12 17:18:41 jak
32 class dbgostrstream
: public ostrstream
37 dbgostrstream( char *str
, int len
, ios::openmode mode
= ios::out
) :
39 dbgostrstream( char *str
, int len
, ios::open_mode mode
= ios::out
) :
41 ostrstream(str
,len
,mode
) {}
42 void flush_to_dbg( int reportType
, int errCode
, int src
);
43 dbgostrstream
&prefix( int reportType
);
47 // The debug stream object itself
48 extern dbgostrstream dbgppStream
;
52 #define Errorpp(n,msg) ((dbgppStream.prefix(DBG_ERROR) << msg),dbgppStream.flush_to_dbg(DBG_ERROR,n,0))
53 #define WarnUserpp(msg) ((dbgppStream.prefix(DBG_WARNUSER) << msg),dbgppStream.flush_to_dbg(DBG_WARNUSER,0,0))
56 #define Warningpp(msg) ((dbgppStream.prefix(DBG_WARNING) << msg),dbgppStream.flush_to_dbg(DBG_WARNING,0,0))
57 #define Assrtpp(expr,msg) if (!(expr)) Warningpp(msg) ; else
59 #define Warningpp(msg) do {} while (0)
60 #define Assertpp(expr,msg) do {} while (0)
64 #define Spewpp(src,msg) do { if (DbgSpewTest(src)) ((dbgppStream.prefix(DBG_SPEW) << msg),dbgppStream.flush_to_dbg(DBG_SPEW,0,(src))); } while (0)
66 #define Spewpp(src,msg) do {} while (0)
71 // If DBG_ON not defined, most macros and functions are macro'ed to
72 // nothing or (0). A few functions remain
74 #define Errorpp(n,msg) ((dbgppStream.prefix(DBG_ERROR) << msg),dbgppStream.flush_to_dbg(DBG_ERROR,n,0))
75 #define WarnUserpp(msg) ((dbgppStream.prefix(DBG_WARNUSER) << msg),dbgppStream.flush_to_dbg(DBG_WARNUSER,0,0))
76 #define Warningpp(msg)
77 #define Assertpp(expr,msg)
78 #define Spewpp(src,msg)