|
Porytiles
|
Concrete implementation of UserDiagnostics that outputs structured messages to stderr, optionally with colored formatting. More...
#include <stderr_styled_user_diagnostics.hpp>
Public Member Functions | |
| StderrStyledUserDiagnostics (const gsl::not_null< TextFormatter * > format) | |
| void | note (const std::string &tag, const std::vector< std::string > &lines) const override |
| Display a multi-line tagged informational note to stderr. | |
| void | warn_note (const std::string &tag, const std::vector< std::string > &lines) const override |
| Display a multi-line tagged warning note to stderr. | |
| void | warn (const std::string &tag, const std::vector< std::string > &lines) const override |
| Display a multi-line tagged warning to stderr. | |
| void | err (const std::string &tag, const std::vector< std::string > &lines) const override |
| Display a multi-line tagged error message to stderr. | |
| void | emit_fatal_proximate (const Error &err) const override |
| Emit the proximate (immediate) error in a fatal error chain to stderr. | |
| void | emit_fatal_step (const Error &err) const override |
| Emit an intermediate step error in a fatal error chain to stderr. | |
| void | emit_fatal_root (const Error &err) const override |
| Emit the root cause error in a fatal error chain to stderr. | |
Public Member Functions inherited from porytiles2::UserDiagnostics | |
| virtual | ~UserDiagnostics ()=default |
| void | note (const std::string &tag, const std::string &msg) const |
| Display a tagged informational note message. | |
| void | warn_note (const std::string &tag, const std::string &msg) const |
| Display a note message with a warning tag. | |
| void | warn (const std::string &tag, const std::string &msg) const |
| Display a tagged warning message. | |
| void | err (const std::string &tag, const std::string &msg) const |
| Display a tagged error message. | |
| template<typename T , typename E > | |
| void | fatal (const ChainableResult< T, E > &result) const |
| Display a fatal error with complete error chain visualization. | |
Concrete implementation of UserDiagnostics that outputs structured messages to stderr, optionally with colored formatting.
StderrStyledUserDiagnostics provides a terminal-based implementation of the UserDiagnostics interface. It outputs all diagnostic messages to stderr with some additional pretty-print structuring. If provided with an AnsiStyledTextFormatter, it will additionally use canonical diagnostic coloring and styling (canonical, i.e. magenta for warnings, red for errors, bolding where appropriate, etc.) via ANSI terminal codes. The implementation includes:
Definition at line 38 of file stderr_styled_user_diagnostics.hpp.
|
inlineexplicit |
Definition at line 40 of file stderr_styled_user_diagnostics.hpp.
|
overridevirtual |
Emit the proximate (immediate) error in a fatal error chain to stderr.
Displays the most immediate error in a fatal error chain with red "fatal:" prefix and the highest visual prominence. This represents the direct cause of the failure.
| err | The proximate error to display |
Implements porytiles2::UserDiagnostics.
Definition at line 61 of file stderr_styled_user_diagnostics.cpp.
|
overridevirtual |
Emit the root cause error in a fatal error chain to stderr.
Displays the root cause error in a fatal error chain using tree-like formatting with Unicode box-drawing characters (└ symbols). This represents the original underlying cause of the failure and appears as the final item in the error hierarchy visualization.
| err | The root cause error to display |
Implements porytiles2::UserDiagnostics.
Definition at line 93 of file stderr_styled_user_diagnostics.cpp.
|
overridevirtual |
Emit an intermediate step error in a fatal error chain to stderr.
Displays intermediate errors in a fatal error chain using tree-like formatting with Unicode box-drawing characters (├ symbols). These represent the intermediate causes between the proximate and root errors in the failure chain.
| err | The step error to display |
Implements porytiles2::UserDiagnostics.
Definition at line 78 of file stderr_styled_user_diagnostics.cpp.
|
overridevirtual |
Display a multi-line tagged error message to stderr.
Outputs error messages with red "error:" prefix and tag suffix on the first line, formatted as "error: <message> [<tag>]" with appropriate indentation for subsequent lines.
| tag | Categorization tag for the error |
| lines | Vector of strings representing each line of the error |
Implements porytiles2::UserDiagnostics.
Definition at line 50 of file stderr_styled_user_diagnostics.cpp.
|
overridevirtual |
Display a multi-line tagged informational note to stderr.
Outputs informational messages with cyan "note:" prefix and tag suffix on the first line, formatted as "note: <message> [<tag>]" with appropriate indentation for subsequent lines.
| tag | Categorization tag for the note |
| lines | Vector of strings representing each line of the note |
Implements porytiles2::UserDiagnostics.
Definition at line 13 of file stderr_styled_user_diagnostics.cpp.
|
overridevirtual |
Display a multi-line tagged warning to stderr.
Outputs warnings with magenta "warning:" prefix and tag suffix on the first line, formatted as "warning: <message> [<tag>]" with appropriate indentation for subsequent lines.
| tag | Categorization tag for the warning |
| lines | Vector of strings representing each line of the warning |
Implements porytiles2::UserDiagnostics.
Definition at line 39 of file stderr_styled_user_diagnostics.cpp.
|
overridevirtual |
Display a multi-line tagged warning note to stderr.
Outputs warning notes with cyan "note:" prefix and tag suffix on the first line, formatted as "note: <message> [<tag>]" with appropriate indentation for subsequent lines.
| tag | Categorization tag for the warning note |
| lines | Vector of strings representing each line of the warning note |
Implements porytiles2::UserDiagnostics.
Definition at line 28 of file stderr_styled_user_diagnostics.cpp.