Class to handle messaging in a simple, consistent stream-based manner. More...
Public Types | |
enum | errorSeverity { INFO, WARNING, SERIOUS, FATAL } |
Severity flags. More... | |
Public Member Functions | |
messageStream (const string &title, errorSeverity, const int maxErrors=0) | |
Construct from components. More... | |
messageStream (const dictionary &) | |
Construct from dictionary. More... | |
const string & | title () const |
Return the title of this error type. More... | |
int | maxErrors () const |
Return the maximum number of errors before program termination. More... | |
int & | maxErrors () |
Return non-const access to the maximum number of errors before. More... | |
OSstream & | masterStream (const label communicator) |
Convert to OSstream. More... | |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
Convert to OSstream. More... | |
OSstream & | operator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
Convert to OSstream. More... | |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const string &ioFileName, const label ioStartLineNumber=-1, const label ioEndLineNumber=-1) |
Convert to OSstream. More... | |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &) |
Convert to OSstream. More... | |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const dictionary &) |
Convert to OSstream. More... | |
operator OSstream & () | |
Convert to OSstream for << operations. More... | |
OSstream & | operator() () |
Explicitly convert to OSstream for << operations. More... | |
Static Public Attributes | |
static int | level |
Protected Attributes | |
string | title_ |
errorSeverity | severity_ |
int | maxErrors_ |
int | errorCount_ |
Class to handle messaging in a simple, consistent stream-based manner.
The messageStream class is globaly instantiated with a title string a given severity, which controls the program termination, and a number of errors before termination. Errors, messages and other data are piped to the messageStream class in the standard manner.
Definition at line 68 of file messageStream.H.
enum errorSeverity |
messageStream | ( | const string & | title, |
errorSeverity | sev, | ||
const int | maxErrors = 0 |
||
) |
Construct from components.
Definition at line 37 of file messageStream.C.
messageStream | ( | const dictionary & | dict | ) |
Construct from dictionary.
Definition at line 50 of file messageStream.C.
|
inline |
Return the title of this error type.
Definition at line 118 of file messageStream.H.
References messageStream::title_.
Referenced by messageStream::operator()(), and Foam::operator<<().
|
inline |
Return the maximum number of errors before program termination.
Definition at line 124 of file messageStream.H.
References messageStream::masterStream(), and messageStream::maxErrors_.
|
inline |
Return non-const access to the maximum number of errors before.
program termination to enable user to reset it
Definition at line 131 of file messageStream.H.
Foam::OSstream & masterStream | ( | const label | communicator | ) |
Convert to OSstream.
Prints to Pout for the master stream
Definition at line 59 of file messageStream.C.
References Foam::endl(), UPstream::master(), messageStream::operator()(), Foam::Pout, error::printStack(), Foam::Snull, UPstream::warnComm, and UPstream::worldComm.
Referenced by messageStream::maxErrors(), smoothSolver::solve(), fvMatrix< Type >::fvSolver::solve(), GAMGSolver::solve(), fvMatrix< Type >::solve(), fvMatrix< Type >::solveCoupled(), fvMatrix< Type >::solver(), and fvMatrix< Type >::solveSegregated().
Foam::OSstream & operator() | ( | const char * | functionName, |
const char * | sourceFileName, | ||
const int | sourceFileLineNumber = 0 |
||
) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 80 of file messageStream.C.
References Foam::endl().
Foam::OSstream & operator() | ( | const string & | functionName, |
const char * | sourceFileName, | ||
const int | sourceFileLineNumber = 0 |
||
) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 99 of file messageStream.C.
Foam::OSstream & operator() | ( | const char * | functionName, |
const char * | sourceFileName, | ||
const int | sourceFileLineNumber, | ||
const string & | ioFileName, | ||
const label | ioStartLineNumber = -1 , |
||
const label | ioEndLineNumber = -1 |
||
) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 115 of file messageStream.C.
References Foam::endl().
Foam::OSstream & operator() | ( | const char * | functionName, |
const char * | sourceFileName, | ||
const int | sourceFileLineNumber, | ||
const IOstream & | ioStream | ||
) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 149 of file messageStream.C.
Foam::OSstream & operator() | ( | const char * | functionName, |
const char * | sourceFileName, | ||
const int | sourceFileLineNumber, | ||
const dictionary & | dict | ||
) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 169 of file messageStream.C.
References Foam::abort(), dict, messageStream::errorCount_, Foam::FatalError, FatalErrorInFunction, messageStream::INFO, Foam::Info, messageStream::level, UPstream::master(), messageStream::maxErrors_, UPstream::parRun(), Foam::Pout, messageStream::SERIOUS, Foam::SeriousError, messageStream::severity_, Foam::Snull, Foam::Sout, messageStream::title(), messageStream::WARNING, and Foam::Warning.
|
inline |
Explicitly convert to OSstream for << operations.
Definition at line 195 of file messageStream.H.
References Foam::Info, Foam::SeriousError, Foam::Warning, and Foam::writeInfoHeader.
Referenced by messageStream::masterStream().
|
protected |
Definition at line 87 of file messageStream.H.
Referenced by messageStream::title().
|
protected |
Definition at line 88 of file messageStream.H.
Referenced by messageStream::operator()().
|
protected |
Definition at line 89 of file messageStream.H.
Referenced by messageStream::maxErrors(), and messageStream::operator()().
|
protected |
Definition at line 90 of file messageStream.H.
Referenced by messageStream::operator()().
|
static |
Definition at line 97 of file messageStream.H.
Referenced by messageStream::operator()(), Foam::operator<<(), and IOobject::setBad().