55 maxErrors_(maxErrors),
80 || severity_ == INFO_STDERR
81 || severity_ == WARNING
96 const bool useStderr =
99 || (severity_ == INFO_STDERR)
112 osptr = (useStderr ? &
Serr : &
Sout);
118 osptr = (useStderr ? &
Perr : &
Pout);
123 (*osptr) << title_.c_str();
126 if (maxErrors_ && (++errorCount_ >= maxErrors_))
129 <<
"Too many errors..."
144 Pout<<
"** messageStream with comm:" << communicator <<
endl;
150 return this->stream();
159 return this->stream().stdStream();
167 const string& functionName
172 if (!functionName.empty())
175 <<
" From " << functionName.c_str() <<
nl;
184 const char* functionName,
185 const char* sourceFileName,
186 const int sourceFileLineNumber
192 <<
" From " << functionName <<
nl
193 <<
" in file " << sourceFileName
194 <<
" at line " << sourceFileLineNumber <<
endl
203 const string& functionName,
204 const char* sourceFileName,
205 const int sourceFileLineNumber
210 functionName.c_str(),
219 const char* functionName,
220 const char* sourceFileName,
221 const int sourceFileLineNumber,
222 const string& ioFileName,
223 const label ioStartLineNumber,
224 const label ioEndLineNumber
230 <<
" From " << functionName <<
nl
231 <<
" in file " << sourceFileName
232 <<
" at line " << sourceFileLineNumber <<
nl
233 <<
" Reading " << ioFileName;
235 if (ioStartLineNumber >= 0)
237 os <<
" at line " << ioStartLineNumber;
239 if (ioStartLineNumber < ioEndLineNumber)
241 os <<
" to " << ioEndLineNumber;
253 const char* functionName,
254 const char* sourceFileName,
255 const int sourceFileLineNumber,
263 sourceFileLineNumber,
265 ioStream.lineNumber(),
273 const char* functionName,
274 const char* sourceFileName,
275 const int sourceFileLineNumber,
283 sourceFileLineNumber,
299 "--> FOAM Warning : ",
305 "--> FOAM Serious Error : ",
An IOstream is an abstract base class for all input/output systems; be they streams,...
Generic output stream using a standard (STL) stream.
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
static label worldComm
Default communicator (all processors)
static bool & parRun() noexcept
Test if this a parallel run.
virtual ITstream & stream() const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
fileName relativeName(const bool caseTag=false) const
The dictionary name relative to the case.
label endLineNumber() const
Return line number of last token in dictionary.
label startLineNumber() const
Return line number of first token in dictionary.
static void printStack(Ostream &os)
Helper function to print a stack.
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
Handle output messages in a simple, consistent stream-based manner.
OSstream & masterStream(const label communicator)
errorSeverity
Message type, error severity flags.
@ INFO_STDERR
General information output (stderr)
@ INFO
General information output (stdout)
@ WARNING
Warning of possible problem.
@ SERIOUS
A serious problem - eg, data corruption.
std::ostream & stdStream()
Return std::ostream for output operations.
static int level
The output level (verbosity) of messages.
static int redirect
The output redirection of messages.
splitCell * master() const
A class for handling character strings derived from std::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
messageStream Info
Information stream (stdout output on master, null elsewhere)
OFstream Snull
Global predefined null output stream "/dev/null".
OSstream Sout
OSstream wrapped stdout (std::cout)
Ostream & endl(Ostream &os)
Add newline and flush stream.
messageStream SeriousError
OSstream Serr
OSstream wrapped stderr (std::cerr)
errorManip< error > abort(error &err)
int infoDetailLevel
Global for selective suppression of Info output.
messageStream InfoErr
Information stream (stderr output on master, null elsewhere)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
constexpr char nl
The newline '\n' character (0x0a)