GCpp general purpose C++ library
version 1.0
|
#include <GLogMessage.hh>
Public Member Functions | |
template<class Q > | |
bool | IsInstanceOf () const |
template<class Q > | |
bool | IsInstanceOf () |
virtual GLogMessage * | Clone () const |
virtual const char * | ClassName () const |
virtual | ~GLogMessage () |
Static Public Member Functions | |
static const char * | StaticClassName () |
static u_int | GetVerboseLevel () |
static void | SetVerboseLevel (u_int v) |
static void | SetLogFile (const string &fname, bool term=true) |
static void | CloseLogFile () |
static void | SendLogMessage (const string &text, u_int verb=1) |
static void | SendLogMessage (const string &text, u_int verb, u_int ref_level) |
static void | SendLogInfo (const string &text) |
static void | SendLogWarning (const string &text) |
static void | SengLogError (const string &text, bool abort=true) |
static void | SendLogMessage (ostream &os, const string &text, u_int verb=1) |
static void | SendLogMessage (ostream &os, const string &text, u_int verb, u_int ref_level) |
static void | SendLogInfo (ostream &os, const string &text) |
static void | SendLogWarning (ostream &os, const string &text) |
static void | SengLogError (ostream &os, const string &text, bool abort=true) |
Protected Member Functions | |
GLogMessage () | |
Static Protected Attributes | |
static u_int | verbose_level = 0 |
Current verbose level. | |
static bool | log_file = false |
Indicates if there is a log file. | |
static bool | log_term = true |
Indicates if there is a log output on terminal. | |
static string | log_file_name = "" |
Log file name. | |
static ofstream | log_file_stream |
Log file stream. | |
This class provides a set of static functions to send messages to a terminal output and/or to a log file.
The different types of text messages are the following:
|
inlineprotected |
Constructor: no need, use static functions.
|
inlinevirtual |
Destructor.
References CloseLogFile().
|
static |
Close the log file (if it was open...). Then the terminal log output is set on.
References log_file, log_file_stream, and log_term.
Referenced by GCloseLogFile(), SetLogFile(), and ~GLogMessage().
|
inlinestatic |
Return the verbose level for information messages.
References verbose_level.
Referenced by GGetVerboseLevel().
|
inline |
Macro from GCpp library that defines the following functions:
|
inlinestatic |
Send an information message to the standard output stream.
text | text to be displayed |
Referenced by GLogInfo().
|
static |
Send an information message (special prefix) to an output stream.
os | output stream |
text | text to be displayed |
References gPrefixInfo, gSuffixInfo, log_term, and SendLogMessage().
|
inlinestatic |
Send a message to the standard output stream, if the argument verbose value is lower or equal to current verbose level. Set the verb value to 0 to display the message in any case.
text | text to be displayed |
verb | requested verbose level to display the message |
Referenced by GLogMessage(), SendLogInfo(), SendLogMessage(), SendLogWarning(), and SengLogError().
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.
text | text to be displayed |
verb | requested verbose level to display the message |
ref_level | external reference verbose level |
References SendLogMessage().
|
static |
Send a message to an output stream, if the argument verbose value is lower or equal to current verbose level. Set the verb value to 0 to display the message in any case.
os | output stream |
text | text to be displayed |
verb | requested run manager verbose level to display the message |
References log_file, log_file_stream, log_term, and verbose_level.
|
static |
Send a message to an 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.
os | output stream |
text | text to be displayed |
verb | requested run manager verbose level to display the message |
ref_level | external reference verbose level |
References log_file, log_file_stream, and log_term.
|
inlinestatic |
Send a warning message (special highlighting) to the standard error stream.
text | text to be displayed |
Referenced by GLogWarning().
|
static |
Send a warning message (special highlighting) to an output stream.
os | output stream |
text | text to be displayed |
References gPrefixWarning, gSuffixWarning, log_term, and SendLogMessage().
|
inlinestatic |
Send an error message (special highlighting) to the standard error stream. The program is then interrupted, except if abort is set to false.
text | text to be displayed |
abort | indicates if program should crash |
Referenced by GLogError().
|
static |
Send an error message (special highlighting) to an output stream. The program is then interrupted, except if abort is set to false.
os | output stream |
text | text to be displayed |
abort | indicates if program should crash |
References gPrefixError, gSuffixError, log_term, and SendLogMessage().
|
static |
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.
fname | name of the log-file |
term | indicate if terminal output is ON/OFF (default is ON) |
References CloseLogFile(), GLogWarning(), log_file, log_file_name, log_file_stream, and log_term.
Referenced by GSetLogFile().
|
inlinestatic |
Set the verbose level for information messages.
v | new verbose level |
References verbose_level.
Referenced by GSetVerboseLevel().