Class to format and write different error/warning information that occured during the initialization.
More...
#include <ErrorHandling.hpp>
|
| enum class | MsgType { Error
, Warning
, Exception
, Undefined
} |
| |
|
| bool | isOutputFileEnabled () const |
| |
| void | enableFileOutput (bool value) |
| | Enable the YAML file output, which is false by default. More...
|
| |
| void | setOutputFilename (std::string_view filename) |
| | Set the name of the YAML file if specified by user default is "errors.yaml". More...
|
| |
| std::string_view | getOutputFilename () |
| |
| ErrorMsg & | currentErrorMsg () |
| | Gives acces to the error message that is currently being constructed, potencially at various application layers Use flushErrorMsg() when the message is fully constructed and you want it to be output. More...
|
| |
|
void | createFile () |
| | Create the YAML file or overwrite the contents if a YAML file of the same name already exists And write its header when the command line option is enabled.
|
| |
| void | flushErrorMsg (ErrorMsg &errorMsg) |
| | Write all the information retrieved about the error/warning message into the YAML file and reset the errorMsg instance to its initial state. More...
|
| |
Class to format and write different error/warning information that occured during the initialization.
Definition at line 32 of file ErrorHandling.hpp.
◆ MsgType
Enum listing the different types of possible errors
Definition at line 40 of file ErrorHandling.hpp.
◆ currentErrorMsg()
| ErrorMsg& geos::ErrorLogger::currentErrorMsg |
( |
| ) |
|
|
inline |
Gives acces to the error message that is currently being constructed, potencially at various application layers Use flushErrorMsg() when the message is fully constructed and you want it to be output.
- Returns
- Reference to the current instance for method chaining.
Definition at line 263 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 240 of file ErrorHandling.hpp.
◆ flushErrorMsg()
| void geos::ErrorLogger::flushErrorMsg |
( |
ErrorMsg & |
errorMsg | ) |
|
Write all the information retrieved about the error/warning message into the YAML file and reset the errorMsg instance to its initial state.
- Parameters
-
| errorMsg | a constant reference to the error |
◆ 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.
◆ isOutputFileEnabled()
| bool geos::ErrorLogger::isOutputFileEnabled |
( |
| ) |
const |
|
inline |
◆ 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 248 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
The documentation for this class was generated from the following file: