Skip to content

DiagnosticOutput

#include <tpau-cpp-kernal/DiagnosticOutput.h>

INCLUDE FILE
#include <tpau-cpp-kernal/DiagnosticOutput.h>

class DiagnosticOutput

DEFINITION
class DiagnosticOutput;

enum Severity

DEFINITION
enum Severity;
VALUEDESCRIPTION
NOTE
WARNING
ERROR

constructor DiagnosticOutput

Create a diagnostic output.

DEFINITION
DiagnosticOutput ( std::ostream & diagnostics_file = std::cerr );
PARAMETERDESCRIPTION
diagnostics_file

The file to output diagnostics to.

method error

Output an error from an exception without location.

DEFINITION
void  error ( Symbol  category,
const Exception & exception );
PARAMETERDESCRIPTION
category

The category of the error.

exception

The exception.

method error

Output an error from a location exception.

DEFINITION
void  error ( Symbol  category,
const LocationException & exception );
PARAMETERDESCRIPTION
category

The category of the error.

exception

The location exception.

method error

Output a formatted error message without location.

DEFINITION
template <typename...Args>
void  error ( Symbol  category,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  error ( Symbol  category,
const Location & location,
const Exception & exception );
PARAMETERDESCRIPTION
category

The category of the error.

location

The location of the error.

exception

The exception.

method error

Output a formatted error message.

DEFINITION
template <typename...Args>
void  error ( Symbol  category,
const Location & location,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  error ( Symbol  category,
const Location & location,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  error ( Symbol  category,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  error ( const Exception & exception );
PARAMETERDESCRIPTION
exception

The exception.

method error

Output an error from a location exception with default category.

DEFINITION
void  error ( const LocationException & exception );
PARAMETERDESCRIPTION
exception

The location exception.

method error

Output a formatted error message with default category and without location.

DEFINITION
template <typename...Args>
void  error ( std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  error ( const Location & location,
const Exception & exception );
PARAMETERDESCRIPTION
location

The location of the error.

exception

The exception.

method error

Output a formatted error message with default category.

DEFINITION
template <typename...Args>
void  error ( const Location & location,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  error ( const Location & location,
std::string_view  message );
PARAMETERDESCRIPTION
location

The location of the error.

message

The message of the error.

method error

Output an error message with default category and without location.

DEFINITION
void  error ( std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
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.

DEFINITION
bool  failed ( ) const;
RETURNSDESCRIPTION
bool

method mark_failed

Mark the program as failed.

DEFINITION
void  mark_failed ( );

method note

Output a note from an exception without location.

DEFINITION
void  note ( Symbol  category,
const Exception & exception );
PARAMETERDESCRIPTION
category

The category of the note.

exception

The exception.

method note

Output a note from a location exception.

DEFINITION
void  note ( Symbol  category,
const LocationException & exception );
PARAMETERDESCRIPTION
category

The category of the note.

exception

The location exception.

method note

Output a formatted note without location.

DEFINITION
template <typename...Args>
void  note ( Symbol  category,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  note ( Symbol  category,
const Location & location,
const Exception & exception );
PARAMETERDESCRIPTION
category

The category of the note.

location

The location of the note.

exception

The exception.

method note

Output a formatted note.

DEFINITION
template <typename...Args>
void  note ( Symbol  category,
const Location & location,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  note ( Symbol  category,
const Location & location,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  note ( Symbol  category,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  note ( const Exception & exception );
PARAMETERDESCRIPTION
exception

The exception.

method note

Output a note from a location exception with default category.

DEFINITION
void  note ( const LocationException & exception );
PARAMETERDESCRIPTION
exception

The location exception.

method note

Output a formatted note with default category and without location.

DEFINITION
template <typename...Args>
void  note ( std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  note ( const Location & location,
const Exception & exception );
PARAMETERDESCRIPTION
location

The location of the note.

exception

The exception.

method note

Output a formatted note with default category.

DEFINITION
template <typename...Args>
void  note ( const Location & location,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  note ( const Location & location,
std::string_view  message );
PARAMETERDESCRIPTION
location

The location of the note.

message

The message of the note.

method note

Output a note with default category and without location.

DEFINITION
void  note ( std::string_view  message );
PARAMETERDESCRIPTION
message

The message of the note.

method output

Output a message from an exception without location.

DEFINITION
void  output ( Symbol  category,
Severity  severity,
const Exception & exception );
PARAMETERDESCRIPTION
category

The category of the message.

severity

The severity of the message.

exception

The exception.

method output

Output a message from a location exception.

DEFINITION
void  output ( Symbol  category,
Severity  severity,
const LocationException & exception );
PARAMETERDESCRIPTION
category

The category of the message.

severity

The severity of the message.

exception

The location exception.

method output

Output a formatted message without location.

DEFINITION
template <typename...Args>
void  output ( Symbol  category,
Severity  severity,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  output ( Symbol  category,
Severity  severity,
const Location & location,
const Exception & exception );
PARAMETERDESCRIPTION
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.

DEFINITION
template <typename...Args>
void  output ( Symbol  category,
Severity  severity,
const Location & location,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  output ( Symbol  category,
Severity  severity,
const Location & location,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  output ( Symbol  category,
Severity  severity,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  output ( Severity  severity,
const Exception & exception );
PARAMETERDESCRIPTION
severity

The severity of the message.

exception

The exception.

method output

Output a message from a location exception with default category.

DEFINITION
void  output ( Severity  severity,
const LocationException & exception );
PARAMETERDESCRIPTION
severity

The severity of the message.

exception

The location exception.

method output

Output a formatted message with default category, without location.

DEFINITION
template <typename...Args>
void  output ( Severity  severity,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  output ( Severity  severity,
const Location & location,
const Exception & exception );
PARAMETERDESCRIPTION
severity

The severity of the message.

location

The location of the message.

exception

The exception.

method output

Output a formatted message with default category.

DEFINITION
template <typename...Args>
void  output ( Severity  severity,
const Location & location,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  output ( Severity  severity,
const Location & location,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  output ( Severity  severity,
std::string_view  message );
PARAMETERDESCRIPTION
severity

The severity of the message.

message

The message to output.

method register_category

Register a category with a severity.

DEFINITION
void  register_category ( Symbol  category,
Severity  severity );
PARAMETERDESCRIPTION
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.

DEFINITION
void  warning ( Symbol  category,
const Exception & exception );
PARAMETERDESCRIPTION
category

The category of the warning.

exception

The exception.

method warning

Output a warning from a location exception.

DEFINITION
void  warning ( Symbol  category,
const LocationException & exception );
PARAMETERDESCRIPTION
category

The category of the warning.

exception

The location exception.

method warning

Output a formatted warning without location.

DEFINITION
template <typename...Args>
void  warning ( Symbol  category,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  warning ( Symbol  category,
const Location & location,
const Exception & exception );
PARAMETERDESCRIPTION
category

The category of the warning.

location

The location of the warning.

exception

The exception.

method warning

Output a formatted warning.

DEFINITION
template <typename...Args>
void  warning ( Symbol  category,
const Location & location,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  warning ( Symbol  category,
const Location & location,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  warning ( Symbol  category,
std::string_view  message );
PARAMETERDESCRIPTION
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.

DEFINITION
void  warning ( const Exception & exception );
PARAMETERDESCRIPTION
exception

The exception.

method warning

Output a warning from a location exception with default category.

DEFINITION
void  warning ( const LocationException & exception );
PARAMETERDESCRIPTION
exception

The location exception.

method warning

Output a formatted warning with default category and without location.

DEFINITION
template <typename...Args>
void  warning ( std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  warning ( const Location & location,
const Exception & exception );
PARAMETERDESCRIPTION
location

The location of the warning.

exception

The exception.

method warning

Output a formatted warning with default category.

DEFINITION
template <typename...Args>
void  warning ( const Location & location,
std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
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.

DEFINITION
void  warning ( const Location & location,
std::string_view  message );
PARAMETERDESCRIPTION
location

The location of the warning.

message

The message of the warning.

method warning

Output a warning with default category and without location.

DEFINITION
void  warning ( std::string_view  message );
PARAMETERDESCRIPTION
message

The message of the warning.

member globalstatic

The global diagnostic output.

DEFINITION
static DiagnosticOutput  global;

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.

DEFINITION
bool  verbose_error_messages;