Class to handle external error capture. This class role is to capture and process external error messages, using the geos logger for better tracing, logging and handling of messages.
More...
#include <ExternalErrorHandler.hpp>
|
|
| ~ExternalErrorHandler () |
| | Destructor, disable all error piping features.
|
| |
| void | setErrorHandling (ErrorHandlingFunctor &&errorHandlingFunctor) |
| | Set the function that process the external errors that have been captured. The processing typically consists in using the given error message, adding metadata, and logging the message. More...
|
| |
| void | enableStderrPipeDeviation (bool enable) |
| | Enable capture of errors piped from the std::cerr stream. Helpful to capture GLIBC errors, or other errors from dependencies not managed by GEOS itself. More...
|
| |
| void | flush (std::string_view detectionLocation) |
| | Process all awaiting captured errors that were produced externally, then clear the error stream. More...
|
| |
|
| static ExternalErrorHandler & | instance () |
| | Strinct singleton pattern has been choosen since we will only have single sources of external errors (stderr for now, we could extend that for HYPRE errors, or for more dependencies). More...
|
| |
| static void | defaultErrorHandling (std::string_view errorMsg, std::string_view detectionLocation) |
| | Not designed for direct calls, error handling function in default use if never calling setErrorHandling(). More...
|
| |
Class to handle external error capture. This class role is to capture and process external error messages, using the geos logger for better tracing, logging and handling of messages.
Definition at line 210 of file ExternalErrorHandler.hpp.
◆ ErrorHandlingFunctor
A functor executed for each error mesage to process, taking the message as the 1st string_view parameter, and the detectionLocation as the 2nd.
- See also
- defaultErrorHandling() for a default implementation.
Definition at line 219 of file ExternalErrorHandler.hpp.
◆ defaultErrorHandling()
| static void geos::ExternalErrorHandler::defaultErrorHandling |
( |
std::string_view |
errorMsg, |
|
|
std::string_view |
detectionLocation |
|
) |
| |
|
static |
Not designed for direct calls, error handling function in default use if never calling setErrorHandling().
- Parameters
-
| errorMsg | the error text message. |
| detectionLocation | A label to describe to the user when the error has been detected. |
◆ enableStderrPipeDeviation()
| void geos::ExternalErrorHandler::enableStderrPipeDeviation |
( |
bool |
enable | ) |
|
Enable capture of errors piped from the std::cerr stream. Helpful to capture GLIBC errors, or other errors from dependencies not managed by GEOS itself.
- Parameters
-
| enable | Enable the feature if true, disable it otherwise. |
- Note
- Disabled by default.
◆ flush()
| void geos::ExternalErrorHandler::flush |
( |
std::string_view |
detectionLocation | ) |
|
Process all awaiting captured errors that were produced externally, then clear the error stream.
- Parameters
-
| detectionLocation | A label to describe when the flush() operation is being made, thus explaining to the user when the error has been detected. |
- See also
- setErrorHandling() to set the error processing procedure.
◆ instance()
Strinct singleton pattern has been choosen since we will only have single sources of external errors (stderr for now, we could extend that for HYPRE errors, or for more dependencies).
- Returns
- The unique global instance.
◆ setErrorHandling()
Set the function that process the external errors that have been captured. The processing typically consists in using the given error message, adding metadata, and logging the message.
- Parameters
-
| errorHandlingFunctor | see ErrorHandlingFunctor. |
- Note
- Implementation treat each independant lines as an single error.
Definition at line 239 of file ExternalErrorHandler.hpp.
The documentation for this class was generated from the following file: