53#ifndef Foam_messageStream_H
54#define Foam_messageStream_H
140 bool use_stderr =
false
149 bool use_stderr =
false
158 bool use_stderr =
false
198 int communicator = -1
214 const int afterVersion,
215 const char* functionName =
nullptr,
216 const char* sourceFileName =
nullptr,
217 const int sourceFileLineNumber = 0
238 const std::string& functionName,
239 const char* sourceFileName =
nullptr,
240 const int sourceFileLineNumber = 0
248 const char* functionName,
249 const char* sourceFileName =
nullptr,
250 const int sourceFileLineNumber = 0
258 const char* functionName,
259 const char* sourceFileName,
260 const int sourceFileLineNumber,
261 const std::string& ioFileName,
262 const label ioStartLineNumber = -1,
263 const label ioEndLineNumber = -1
271 const char* functionName,
272 const char* sourceFileName,
273 const int sourceFileLineNumber,
282 const char* functionName,
283 const char* sourceFileName,
284 const int sourceFileLineNumber,
336 #define FUNCTION_NAME __PRETTY_FUNCTION__
338 #define FUNCTION_NAME __func__
344#define SeriousErrorIn(functionName) \
345 ::Foam::SeriousError((functionName), __FILE__, __LINE__)
349#define SeriousErrorInFunction SeriousErrorIn(FUNCTION_NAME)
355#define SeriousIOErrorIn(functionName, ios) \
356 ::Foam::SeriousError((functionName), __FILE__, __LINE__, ios)
361#define SeriousIOErrorInFunction(ios) SeriousIOErrorIn(FUNCTION_NAME, ios)
366#define WarningIn(functionName) \
367 ::Foam::Warning((functionName), __FILE__, __LINE__)
371#define WarningInFunction WarningIn(FUNCTION_NAME)
375#define DeprecatedInFunction(afterVersion) \
376 ::Foam::Warning.deprecated(afterVersion, FUNCTION_NAME, __FILE__, __LINE__)
382#define IOWarningIn(functionName, ios) \
383 ::Foam::Warning((functionName), __FILE__, __LINE__, (ios))
388#define IOWarningInFunction(ios) IOWarningIn(FUNCTION_NAME, ios)
393#define InfoIn(functionName) \
394 ::Foam::Info((functionName), __FILE__, __LINE__)
398#define InfoInFunction InfoIn(FUNCTION_NAME)
401#define PoutIn(functionName) \
402 ::Foam::Pout << (functionName) << ':'
405#define PoutInFunction PoutIn(FUNCTION_NAME)
409 if (::Foam::infoDetailLevel > 0) ::Foam::Info
413 if (log) ::Foam::Info
417 if (this->log) ::Foam::Info
423#define IOInfoIn(functionName, ios) \
424 ::Foam::Info((functionName), __FILE__, __LINE__, (ios))
429#define IOInfoInFunction(ios) IOInfoIn(FUNCTION_NAME, ios)
435 if (debug) ::Foam::Info
440#define DebugInFunction \
441 if (debug) InfoInFunction
446 if (debug) ::Foam::Pout
451#define DebugPoutInFunction \
452 if (debug) PoutInFunction
456#define DebugVar(var) \
458 ::Foam::string oldPrefix(::Foam::Pout.prefix()); \
459 ::Foam::Pout<< "["<< __FILE__ << ":" << __LINE__ << "] "; \
460 ::Foam::Pout.prefix() = oldPrefix + #var " "; \
461 ::Foam::Pout<< var << ::Foam::endl; \
462 ::Foam::Pout.prefix() = oldPrefix; \
An IOstream is an abstract base class for all input/output systems; be they streams,...
Generic output stream using a standard (STL) stream.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Handle output messages in a simple, consistent stream-based manner.
messageStream(errorSeverity severity, int maxErrors=0, bool use_stderr=false)
Construct untitled with given characteristics.
int errorCount_
The current number of errors counted.
int maxErrors() const noexcept
The maximum number of errors before program termination.
int severity_
The message type / error severity, possibly with USE_STDERR mask.
std::ostream & stdStream()
Return std::ostream for output operations.
OSstream & stream(OSstream *alternative=nullptr, int communicator=-1)
Return OSstream for output operations.
OSstream & deprecated(const int afterVersion, const char *functionName=nullptr, const char *sourceFileName=nullptr, const int sourceFileLineNumber=0)
Report deprecation (after specified API version) with 'From function-name, source file,...
errorSeverity
Message type, error severity flags.
@ USE_STDERR
Bitmask for stderr output (for the above enums).
@ INFO
General information output (stdout).
@ WARNING
Warning of possible problem.
@ SERIOUS
A serious problem - eg, data corruption.
OSstream & masterStream(int communicator)
Return OSstream for output operations on the master process only, Snull on other processes.
int maxErrors_
The maximum number of errors before program termination.
int maxErrors(int nErrors) noexcept
Set the maximum number of errors before program termination.
OSstream & operator()()
Explicitly convert to OSstream for << operations.
static int level
The output level (verbosity) of messages.
static int redirect
The output redirection of messages.
const string & title() const noexcept
The title of this error type.
string title_
The title of this error type.
messageStream Info
Information stream (stdout output on master, null elsewhere).
messageStream SeriousError
Error stream (stdout output on all processes), with additional 'FOAM Serious Error' header text.
int infoDetailLevel
Global for selective suppression of Info output.
messageStream InfoErr
Information stream (stderr output on master, null elsewhere).
messageStream Warning
Warning stream (stdout output on master, null elsewhere), with additional 'FOAM Warning' header text.