Logger for formatting and outputting diagnostics.
More...
#include <ErrorHandling.hpp>
Logger for formatting and outputting diagnostics.
Definition at line 284 of file ErrorHandling.hpp.
◆ enableFileOutput()
| void geos::ErrorLogger::enableFileOutput |
( |
bool |
value | ) |
|
|
inline |
Enable the YAML file output, which is false by default.
- Parameters
-
| value | A value of true enable the file writing |
Definition at line 308 of file ErrorHandling.hpp.
◆ flushErrorMsg()
Write all the information retrieved about the diagnostic message into the instance outputs (stream specified, std::cout by default + optional yaml file)
- Parameters
-
| errMsg | a reference to the ErrorMsg to output, and will be re-initialized |
- Note
- Used for warnings and non-exception errors
◆ formatMsgForLog()
| static void geos::ErrorLogger::formatMsgForLog |
( |
DiagnosticMsg const & |
errMsg, |
|
|
std::ostream & |
os |
|
) |
| |
|
static |
Format all information in ErrorMsg and write it to the specified output stream.
- Parameters
-
| errMsg | The struct containing the error/warning object |
| os | The output stream |
◆ getCurrentExceptionMsg()
| DiagnosticMsg const& geos::ErrorLogger::getCurrentExceptionMsg |
( |
| ) |
const |
|
inline |
◆ getErrorStream()
| std::ostream const& geos::ErrorLogger::getErrorStream |
( |
| ) |
const |
|
inline |
◆ getOutputFilename()
| std::string_view geos::ErrorLogger::getOutputFilename |
( |
| ) |
|
|
inline |
◆ global()
- Returns
- Global instance of the ErrorLogger class used for error/warning reporting.
This global instance is used across the codebase to log errors, warnings, and exceptions, and to write structured output of errors. It is used through the logging macros.
- Note
- - local instances are possible for more specialized logging.
- currently not available on GPU, use GEOS_WARNING/ERROR/ASSERT macros for this usecase.
◆ initCurrentExceptionMessage()
Start building a new exception message.
- Parameters
-
| msgType | Type of diagnostic (Warning, Error or Exception) |
| msgContent | the message that can be completed |
| rank | the rank(s) on which the diagnostic occured |
- Returns
- Builder for the exception
- Note
- One exception can exist at a time
◆ isOutputFileEnabled()
| bool geos::ErrorLogger::isOutputFileEnabled |
( |
| ) |
const |
|
inline |
◆ modifyCurrentExceptionMessage()
Modify/Continue building the current exception message.
- Returns
- Builder for the exception
Definition at line 366 of file ErrorHandling.hpp.
◆ setOutputFilename()
| void geos::ErrorLogger::setOutputFilename |
( |
std::string_view |
filename | ) |
|
|
inline |
Set the name of the YAML file if specified by user default is "errors.yaml".
- Parameters
-
| filename | the name of the YAML file |
Definition at line 322 of file ErrorHandling.hpp.
◆ toString()
| static std::string geos::ErrorLogger::toString |
( |
MsgType |
type | ) |
|
|
static |
Convert a MsgType into a string.
- Parameters
-
| type | the message type label |
- Returns
- the string representation of the message type
◆ writeToLogStream()
| void geos::ErrorLogger::writeToLogStream |
( |
DiagnosticMsg & |
errMsg | ) |
|
Write the ErrorMsg into the log stream output stream.
- Parameters
-
| errMsg | The struct containing the error/warning object |
The documentation for this class was generated from the following file: