DiagnosticOutput
class DiagnosticOutput
enum Severity
| VALUE | DESCRIPTION |
|---|---|
NOTE |
|
WARNING |
|
ERROR |
constructor DiagnosticOutput
Create a diagnostic output.
| DiagnosticOutput | ( | std::ostream & diagnostics_file = std::cerr | ); |
| PARAMETER | DESCRIPTION |
|---|---|
diagnostics_file |
The file to output diagnostics to. |
method error
Output an error from an exception without location.
| void error | ( | Symbol category, | |
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the error. |
exception |
The exception. |
method error
Output an error from a location exception.
| void error | ( | Symbol category, | |
| const LocationException & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the error. |
exception |
The location exception. |
method error
Output a formatted error message without location.
| void error | ( | Symbol category, | |
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the error. |
format |
The format string for the error message. |
args |
The arguments for the format string. |
method error
Output an error from an exception.
| void error | ( | Symbol category, | |
| const Location & location, | |||
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the error. |
location |
The location of the error. |
exception |
The exception. |
method error
Output a formatted error message.
| void error | ( | Symbol category, | |
| const Location & location, | |||
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the error. |
location |
The location of the error. |
format |
The format string for the error message. |
args |
The arguments for the format string. |
method error
Output an error message.
| void error | ( | Symbol category, | |
| const Location & location, | |||
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the error. |
location |
The location of the error. |
message |
The message of the error. |
method error
Output an error message without location.
| void error | ( | Symbol category, | |
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the error. |
message |
The message of the error. |
method error
Output an error from an exception with default category and without location.
| void error | ( | const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
exception |
The exception. |
method error
Output an error from a location exception with default category.
| void error | ( | const LocationException & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
exception |
The location exception. |
method error
Output a formatted error message with default category and without location.
| void error | ( | std::format_string< Args... > format, | |
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
format |
The format string for the error message. |
args |
The arguments for the format string. |
method error
Output an error from an exception with default category.
| void error | ( | const Location & location, | |
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the error. |
exception |
The exception. |
method error
Output a formatted error message with default category.
| void error | ( | const Location & location, | |
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the error. |
format |
The format string for the error message. |
args |
The arguments for the format string. |
method error
Output an error message with default category.
| void error | ( | const Location & location, | |
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the error. |
message |
The message of the error. |
method error
Output an error message with default category and without location.
| void error | ( | std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
message |
The message of the error. |
method exit_if_failed
Cause the program to exit by throwing an exception if it has been marked as failed.
| void exit_if_failed | ( | ); |
method failedconst
Check if the program has been marked as failed.
This can either been done explicitly by calling mark_failed(), or implicitly by outputting a message with a severity equal to or higher than the fail severity, which defaults to error.
| bool failed | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method log_exceptions
Log exceptions thrown by the callable.
This function calls the provided callable and logs any exceptions it throws.
If callable returns void, true is returned if no exception was thrown, and false otherwise.
If callable returns a value, an optional containing the result is returned if no exception was thrown, and {} otherwise.
| std::conditional_t< std::is_void_v< std::invoke_result_t< Callable && > >, bool, std::optional< std::invoke_result_t< Callable && > > > log_exceptions | ( | Callable && callable | ); |
| PARAMETER | DESCRIPTION |
|---|---|
callable |
The callable to invoke. |
| RETURNS | DESCRIPTION |
|---|---|
std::conditional_t< std::is_void_v< std::invoke_result_t< Callable && > >, bool, std::optional< std::invoke_result_t< Callable && > > > |
The result or |
method mark_failed
Mark the program as failed.
| void mark_failed | ( | ); |
method note
Output a note from an exception without location.
| void note | ( | Symbol category, | |
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the note. |
exception |
The exception. |
method note
Output a note from a location exception.
| void note | ( | Symbol category, | |
| const LocationException & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the note. |
exception |
The location exception. |
method note
Output a formatted note without location.
| void note | ( | Symbol category, | |
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the note. |
format |
The format string for the note message. |
args |
The arguments for the format string. |
method note
Output a note from an exception.
| void note | ( | Symbol category, | |
| const Location & location, | |||
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the note. |
location |
The location of the note. |
exception |
The exception. |
method note
Output a formatted note.
| void note | ( | Symbol category, | |
| const Location & location, | |||
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the note. |
location |
The location of the note. |
format |
The format string for the note message. |
args |
The arguments for the format string. |
method note
Output a note.
| void note | ( | Symbol category, | |
| const Location & location, | |||
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the note. |
location |
The location of the note. |
message |
The message of the note. |
method note
Output a note without location.
| void note | ( | Symbol category, | |
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the note. |
message |
The message of the note. |
method note
Output a note from an exception with default category and without location.
| void note | ( | const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
exception |
The exception. |
method note
Output a note from a location exception with default category.
| void note | ( | const LocationException & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
exception |
The location exception. |
method note
Output a formatted note with default category and without location.
| void note | ( | std::format_string< Args... > format, | |
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
format |
The format string for the note message. |
args |
The arguments for the format string. |
method note
Output a note from an exception with default category.
| void note | ( | const Location & location, | |
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the note. |
exception |
The exception. |
method note
Output a formatted note with default category.
| void note | ( | const Location & location, | |
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the note. |
format |
The format string for the note message. |
args |
The arguments for the format string. |
method note
Output a note with default category.
| void note | ( | const Location & location, | |
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the note. |
message |
The message of the note. |
method note
Output a note with default category and without location.
| void note | ( | std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
message |
The message of the note. |
method output
Output a message from an exception without location.
| void output | ( | Symbol category, | |
| Severity severity, | |||
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the message. |
severity |
The severity of the message. |
exception |
The exception. |
method output
Output a message from a location exception.
| void output | ( | Symbol category, | |
| Severity severity, | |||
| const LocationException & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the message. |
severity |
The severity of the message. |
exception |
The location exception. |
method output
Output a formatted message without location.
| void output | ( | Symbol category, | |
| Severity severity, | |||
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the message. |
severity |
The severity of the message. |
format |
The format string for the message. |
args |
The arguments for the format string. |
method output
Output a message from an exception.
| void output | ( | Symbol category, | |
| Severity severity, | |||
| const Location & location, | |||
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the message. |
severity |
The severity of the message. |
location |
The location of the message. |
exception |
The exception. |
method output
Output a formatted message.
| void output | ( | Symbol category, | |
| Severity severity, | |||
| const Location & location, | |||
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the message. |
severity |
The severity of the message. |
location |
The location of the message. |
format |
The format string for the message. |
args |
The arguments for the format string. |
method output
Output a message.
| void output | ( | Symbol category, | |
| Severity severity, | |||
| const Location & location, | |||
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the message. |
severity |
The severity of the message. |
location |
The location of the message. |
message |
The message to output. |
method output
Output a message without location.
| void output | ( | Symbol category, | |
| Severity severity, | |||
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the message. |
severity |
The severity of the message. |
message |
The message to output. |
method output
Output a message from an exception with default category and without location.
| void output | ( | Severity severity, | |
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
severity |
The severity of the message. |
exception |
The exception. |
method output
Output a message from a location exception with default category.
| void output | ( | Severity severity, | |
| const LocationException & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
severity |
The severity of the message. |
exception |
The location exception. |
method output
Output a formatted message with default category, without location.
| void output | ( | Severity severity, | |
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
severity |
The severity of the message. |
format |
The format string for the message. |
args |
The arguments for the format string. |
method output
Output a message from an exception with default category.
| void output | ( | Severity severity, | |
| const Location & location, | |||
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
severity |
The severity of the message. |
location |
The location of the message. |
exception |
The exception. |
method output
Output a formatted message with default category.
| void output | ( | Severity severity, | |
| const Location & location, | |||
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
severity |
The severity of the message. |
location |
The location of the message. |
format |
The format string for the message. |
args |
The arguments for the format string. |
method output
Output a message with default category.
| void output | ( | Severity severity, | |
| const Location & location, | |||
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
severity |
The severity of the message. |
location |
The location of the message. |
message |
The message to output. |
method output
Output a message with default category and without location.
| void output | ( | Severity severity, | |
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
severity |
The severity of the message. |
message |
The message to output. |
method register_category
Register a category with a severity.
| void register_category | ( | Symbol category, | |
| Severity severity | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category to register. |
severity |
The minimum severity for messages in the category to be printed. |
method warning
Output a warning from an exception without location.
| void warning | ( | Symbol category, | |
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the warning. |
exception |
The exception. |
method warning
Output a warning from a location exception.
| void warning | ( | Symbol category, | |
| const LocationException & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the warning. |
exception |
The location exception. |
method warning
Output a formatted warning without location.
| void warning | ( | Symbol category, | |
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the warning. |
format |
The format string for the warning message. |
args |
The arguments for the format string. |
method warning
Output a warning from an exception.
| void warning | ( | Symbol category, | |
| const Location & location, | |||
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the warning. |
location |
The location of the warning. |
exception |
The exception. |
method warning
Output a formatted warning.
| void warning | ( | Symbol category, | |
| const Location & location, | |||
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the warning. |
location |
The location of the warning. |
format |
The format string for the warning message. |
args |
The arguments for the format string. |
method warning
Output a warning.
| void warning | ( | Symbol category, | |
| const Location & location, | |||
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the warning. |
location |
The location of the warning. |
message |
The message of the warning. |
method warning
Output a warning without location.
| void warning | ( | Symbol category, | |
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
category |
The category of the warning. |
message |
The message of the warning. |
method warning
Output a warning from an exception with default category and without location.
| void warning | ( | const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
exception |
The exception. |
method warning
Output a warning from a location exception with default category.
| void warning | ( | const LocationException & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
exception |
The location exception. |
method warning
Output a formatted warning with default category and without location.
| void warning | ( | std::format_string< Args... > format, | |
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
format |
The format string for the warning message. |
args |
The arguments for the format string. |
method warning
Output a warning from an exception with default category.
| void warning | ( | const Location & location, | |
| const Exception & exception | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the warning. |
exception |
The exception. |
method warning
Output a formatted warning with default category.
| void warning | ( | const Location & location, | |
| std::format_string< Args... > format, | |||
| Args &&... args | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the warning. |
format |
The format string for the warning message. |
args |
The arguments for the format string. |
method warning
Output a warning with default category.
| void warning | ( | const Location & location, | |
| std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the warning. |
message |
The message of the warning. |
method warning
Output a warning with default category and without location.
| void warning | ( | std::string_view message | ); |
| PARAMETER | DESCRIPTION |
|---|---|
message |
The message of the warning. |
member globalstatic
The global diagnostic output.
member verbose_error_messages
Whether to output verbose error messages.
This is not used by the Kernal itself. It is provided for use by the application.