|
Porytiles
|
Abstract interface for structured error reporting and diagnostic output. More...
#include <user_diagnostics.hpp>
Public Member Functions | |
| virtual | ~UserDiagnostics ()=default |
| void | note (const std::string &tag, const std::string &msg) const |
| Display a tagged informational note message. | |
| virtual void | note (const std::string &tag, const std::vector< std::string > &lines) const =0 |
| Display a multi-line tagged informational note message. | |
| void | warn_note (const std::string &tag, const std::string &msg) const |
| Display a note message with a warning tag. | |
| virtual void | warn_note (const std::string &tag, const std::vector< std::string > &lines) const =0 |
| Display a multi-line tagged warning note message. | |
| void | warn (const std::string &tag, const std::string &msg) const |
| Display a tagged warning message. | |
| virtual void | warn (const std::string &tag, const std::vector< std::string > &lines) const =0 |
| Display a multi-line tagged warning message. | |
| void | err (const std::string &tag, const std::string &msg) const |
| Display a tagged error message. | |
| virtual void | err (const std::string &tag, const std::vector< std::string > &lines) const =0 |
| Display a multi-line tagged error message. | |
| virtual void | emit_fatal_proximate (const Error &err) const =0 |
| Emit the proximate (immediate) error in a fatal error chain. | |
| virtual void | emit_fatal_step (const Error &err) const =0 |
| Emit an intermediate step error in a fatal error chain. | |
| virtual void | emit_fatal_root (const Error &err) const =0 |
| Emit the root cause error in a fatal error chain. | |
| template<typename T , typename E > | |
| void | fatal (const ChainableResult< T, E > &result) const |
| Display a fatal error with complete error chain visualization. | |
Abstract interface for structured error reporting and diagnostic output.
UserDiagnostics provides a polymorphic interface for communicating diagnostics, warnings, errors, and fatal conditions to users. The class supports multiple severity levels and integrates with the ChainableResult error system to provide hierarchical error chain visualization.
The diagnostic system categorizes output into:
All methods support both single-line messages (std::string) and multi-line messages (std::vector<std::string>) for flexible diagnostic formatting.
Definition at line 30 of file user_diagnostics.hpp.
|
virtualdefault |
|
pure virtual |
Emit the proximate (immediate) error in a fatal error chain.
Virtual method for displaying the most immediate error in a fatal error chain. This is typically the first error encountered and is displayed with the highest visual prominence.
| err | The proximate error to display |
Implemented in porytiles2::BufferedUserDiagnostics, and porytiles2::StderrStyledUserDiagnostics.
|
pure virtual |
Emit the root cause error in a fatal error chain.
Virtual method for displaying the root cause error in a fatal error chain. This represents the original underlying cause of the failure and is typically displayed as the final item in the error hierarchy.
| err | The root cause error to display |
Implemented in porytiles2::BufferedUserDiagnostics, and porytiles2::StderrStyledUserDiagnostics.
|
pure virtual |
Emit an intermediate step error in a fatal error chain.
Virtual method for displaying intermediate errors in a fatal error chain. These are errors that occurred between the proximate and root causes, typically displayed with tree-like formatting to show the error hierarchy.
| err | The step error to display |
Implemented in porytiles2::BufferedUserDiagnostics, and porytiles2::StderrStyledUserDiagnostics.
|
inline |
Display a tagged error message.
Errors indicate serious issues that require attention but don't necessarily cause immediate failure of the current operation. They include a categorization tag to help users understand and/or filter the type of error being reported.
| tag | Categorization tag for the error |
| msg | The error message to display |
Definition at line 145 of file user_diagnostics.hpp.
|
pure virtual |
Display a multi-line tagged error message.
Virtual method for displaying multi-line error messages. Implementations typically format the first line with an "error:" prefix and subsequent lines with appropriate indentation.
| tag | Categorization tag for the error |
| lines | Vector of strings representing each line of the error |
Implemented in porytiles2::BufferedUserDiagnostics, and porytiles2::StderrStyledUserDiagnostics.
|
inline |
Display a fatal error with complete error chain visualization.
Processes a ChainableResult error chain to display a hierarchical view of all errors that led to the fatal condition. The error chain is displayed in order from proximate (immediate) cause to root cause, creating a tree-like structure that helps users understand the failure path.
The method handles three types of errors in the chain:
| T | The success value type of the ChainableResult |
| E | The error type of the ChainableResult |
| result | The failed ChainableResult containing the error chain |
Definition at line 217 of file user_diagnostics.hpp.
|
inline |
Display a tagged informational note message.
Notes are the lowest severity diagnostic level, used for informational messages that help users understand what's happening without indicating any problems. They include a categorization tag to help users understand and/or filter the type of note being reported.
| tag | Categorization tag for the note |
| msg | The informational message to display |
Definition at line 45 of file user_diagnostics.hpp.
|
pure virtual |
Display a multi-line tagged informational note message.
Virtual method for displaying multi-line informational messages. Implementations typically format the first line with a "note:" prefix and subsequent lines with appropriate indentation.
| tag | Categorization tag for the note |
| lines | Vector of strings representing each line of the note |
Implemented in porytiles2::BufferedUserDiagnostics, and porytiles2::StderrStyledUserDiagnostics.
|
inline |
Display a tagged warning message.
Warnings indicate non-fatal issues that users should be aware of. They include a categorization tag to help users understand and/or filter the type of warning being reported.
| tag | Categorization tag for the warning |
| msg | The warning message to display |
Definition at line 99 of file user_diagnostics.hpp.
|
pure virtual |
Display a multi-line tagged warning message.
Virtual method for displaying multi-line warnings with categorization. Implementations typically format the first line with a "warning:" prefix and the tag, with subsequent lines appropriately indented.
| tag | Categorization tag for the warning |
| lines | Vector of strings representing each line of the warning |
Implemented in porytiles2::BufferedUserDiagnostics, and porytiles2::StderrStyledUserDiagnostics.
|
inline |
Display a note message with a warning tag.
Warning notes are note messages that are emitted in concert with a specific warning. They have tags so that like warnings they can be filtered by the user.
| tag | Categorization tag for the warning note |
| msg | The warning note message to display |
Definition at line 72 of file user_diagnostics.hpp.
|
pure virtual |
Display a multi-line tagged warning note message.
Virtual method for displaying multi-line warning notes with categorization. Implementations typically format these with note-style prefixes but include the tag for categorization purposes.
| tag | Categorization tag for the warning note |
| lines | Vector of strings representing each line of the warning note |
Implemented in porytiles2::BufferedUserDiagnostics, and porytiles2::StderrStyledUserDiagnostics.