GCpp general purpose C++ library  version 1.0
GLogMessage.icc File Reference

Macros

#define GClassWarning(TEXT)
 
#define GClassError(TEXT)
 
#define GDebugClass(TEXT, VERB)   { }
 
#define GDebugConst(TEXT, VERB)   { }
 
#define GDebugDest(VERB)   { }
 

Functions

u_int GGetVerboseLevel ()
 
void GSetVerboseLevel (u_int v)
 
void GSetLogFile (const string &fname, bool term)
 
void GCloseLogFile ()
 
void GLogMessage (const string &text, u_int verb)
 
void GLogMessage (const string &text, u_int verb, u_int ref_level)
 
void GLogInfo (const string &text)
 
void GLogWarning (const string &text)
 
void GLogError (const string &text, bool abort)
 
void GLogMessage (ostream &os, const string &text, u_int verb)
 
void GLogInfo (ostream &os, const string &text)
 
void GLogWarning (ostream &os, const string &text)
 
void GLogError (ostream &os, const string &text, bool abort)
 
void GDebugText (const string &, u_int)
 
void GDebugLine (const string &, u_int)
 

Detailed Description

Inline functions file for the GLogMessage class

Macro Definition Documentation

#define GClassError (   TEXT)
Value:
{ string _txt_warn = gPrefixError + " 0x" + GGetString((void *) this) \
+ " " + StaticClassName() + " " + string(TEXT) \
+ gSuffixWarning.substr(0,gSuffixError.length()-1); \
GLogMessage ( _txt_warn ); }
string gSuffixWarning
! Suffix for warning messages
Definition: GBaseFunctions.cpp:28
string GGetString(const int64 val, const u_int len, const char c)
Definition: GStringFunctions.cpp:21
void GLogMessage(const string &text, u_int verb=0)
Definition: GLogMessage.icc:110
string gPrefixError
! Prefix for error messages
Definition: GBaseFunctions.cpp:13
string gSuffixError
! Suffix for error messages
Definition: GBaseFunctions.cpp:25

Error message issued from a class (for run-time warnings).

Referenced by GVectT< T >::At(), GListT< T >::At(), GTreeLeafT< T >::GTreeLeafT(), and GVectT< T >::operator[]().

#define GClassWarning (   TEXT)
Value:
{ string _txt_warn = gPrefixWarning + " 0x" + GGetString((void *) this) \
+ " " + StaticClassName() + " " + string(TEXT) \
+ gSuffixWarning.substr(0,gSuffixWarning.length()-1); \
GLogMessage ( _txt_warn ); }
string gSuffixWarning
! Suffix for warning messages
Definition: GBaseFunctions.cpp:28
string gPrefixWarning
! Prefix for warning messages
Definition: GBaseFunctions.cpp:16
string GGetString(const int64 val, const u_int len, const char c)
Definition: GStringFunctions.cpp:21
void GLogMessage(const string &text, u_int verb=0)
Definition: GLogMessage.icc:110

Warning message issued from a class (for run-time warnings).

Referenced by GNamedListT< T >::__Add(), GListT< T >::__Add(), GVectT< T >::__Assign(), GNamedListT< T >::__Insert(), GListT< T >::__Insert(), GIntervalList::Add(), GListT< T >::Add(), GVectT< T >::Assign(), and GListT< T >::Insert().

#define GDebugConst (   TEXT,
  VERB 
)    { }

Send a debugging message with class information to the standard error stream, if GDEBUG variable is defined and its value is greater than or equal to the argument value.

Referenced by GBaseSampleFFT::GBaseSampleFFT(), GListIterT< T >::GListIterT(), GListT< T >::GListT(), GNamedListT< T >::GNamedListT(), GRealSampleFFT::GRealSampleFFT(), GSortListT< T >::GSortListT(), GTreeBranchT< T >::GTreeBranchT(), GTreeLeafT< T >::GTreeLeafT(), GTreeNodeT< T >::GTreeNodeT(), GVectIterT< T >::GVectIterT(), and GVectT< T >::GVectT().

#define GDebugDest (   VERB)    { }

Function Documentation

void GCloseLogFile ( )
inline

Close the log file (set output to standard outputs).

References GLogMessage::CloseLogFile().

void GDebugLine ( const string &  ,
u_int   
)
inline

Send a debugging line to the standard error stream, if GDEBUG variable is defined and its value is greater than or equal to the verb argument value.

void GDebugText ( const string &  ,
u_int   
)
inline

Send a debugging message to the standard error stream, if GDEBUG variable is defined and its value is greater than or equal to the verb argument value.

u_int GGetVerboseLevel ( )
inline

Get the information verbose level.

References GLogMessage::GetVerboseLevel().

void GLogError ( const string &  text,
bool  abort 
)
inline

Send an error message (special highlighting) to the standard error stream. The program is then interrupted, except if abort is set to false. (short-cut the GLogMessage static function).

Parameters
texttext to be displayed
abortindicates if program should crash

References GLogMessage::SengLogError().

void GLogError ( ostream &  os,
const string &  text,
bool  abort 
)
inline

Send an error message (special highlighting) to an output stream. The program is then interrupted, except if abort is set to false. (short-cut the GLogMessage static function).

Parameters
osoutput stream
texttext to be displayed
abortindicates if program should crash

References GLogMessage::SengLogError().

void GLogInfo ( const string &  text)
inline

Send an information message to the standard output stream. (short-cut the GLogMessage static function).

Parameters
texttext to be displayed

References GLogMessage::SendLogInfo().

void GLogInfo ( ostream &  os,
const string &  text 
)
inline

Send an information message to an output stream. (short-cut the GLogMessage static function).

Parameters
osoutput stream
texttext to be displayed

References GLogMessage::SendLogInfo().

void GLogMessage ( const string &  text,
u_int  verb 
)
inline

Send a message to the standard output stream, if the given verbose value is lower or equal to the run manager value. (short-cut the GLogMessage static function).

Parameters
texttext to be displayed
verbrequested verbose level to display the message

References GLogMessage::SendLogMessage().

void GLogMessage ( const string &  text,
u_int  verb,
u_int  ref_level 
)
inline

Send a message to the standard output stream, if the argument verbose value is lower or equal to the external reference verbose level ref_level. This function is for use with packages that define their own verbose level. Set the verb value to 0 to display the message in any case.

Parameters
texttext to be displayed
verbrequested verbose level to display the message
ref_levelexternal reference verbose level

References GLogMessage::SendLogMessage().

void GLogMessage ( ostream &  os,
const string &  text,
u_int  verb 
)
inline

Send a message to an output stream, if the given verbose value is lower or equal to the run manager value. Set the verb value to display the message in any case. (short-cut the GLogMessage static function).

Parameters
osoutput stream
texttext to be displayed
verbrequested verbose level to display the message

References GLogMessage::SendLogMessage().

void GLogWarning ( const string &  text)
inline
void GLogWarning ( ostream &  os,
const string &  text 
)
inline

Send a warning message (special highlighting) to an output stream. (short-cut the GLogMessage static function).

Parameters
osoutput stream
texttext to be displayed

References GLogMessage::SendLogWarning().

void GSetLogFile ( const string &  fname,
bool  term 
)
inline

Indicate a log file name for simulation messages. When messages are sent to a log file, it is possible to switch off the terminal messages, if argument term is set to false. (this function is a short-cut the GLogMessage static function).

Parameters
fnamename of the log-file
termindicate if terminal output is ON/OFF (default is ON)

References GLogMessage::SetLogFile().

void GSetVerboseLevel ( u_int  v)
inline

Set the information verbose level.

Parameters
vnew verbose level

References GLogMessage::SetVerboseLevel().