载入中...
搜索中...
未找到
Diagnostic.h
浏览该文件的文档.
39inline std::ostream& operator<<(std::ostream& stream, Severity severity) { return stream << severityName(severity); }
94class [[nodiscard("Diagnostic should be inspected or passed to a Result")]] EVENGINE_API_FOUNDATION Diagnostic {
128 return Diagnostic(code, Severity::Error, std::move(message), std::move(path), std::move(details),
137 return Diagnostic(code, Severity::Warning, std::move(message), std::move(path), std::move(details),
156 void addDetail(std::string key, std::string value) { details_.emplace_back(std::move(key), std::move(value)); }
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
const std::string & path() const noexcept
Optional field, property, URI, or logical path.
Definition Diagnostic.h:149
void addDetail(std::string key, std::string value)
Add structured context without changing the stable code.
Definition Diagnostic.h:156
Diagnostic(DiagnosticCode code, Severity severity, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct a diagnostic with its stable code and human text.
Definition Diagnostic.h:109
static Diagnostic warning(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct a warning diagnostic.
Definition Diagnostic.h:134
bool isError() const noexcept
Whether the diagnostic represents an error or fatal condition.
Definition Diagnostic.h:159
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
const DiagnosticDetails & details() const noexcept
Structured context in insertion order.
Definition Diagnostic.h:151
const std::string & source() const noexcept
Optional producer or subsystem that emitted the diagnostic.
Definition Diagnostic.h:153
std::vector< DiagnosticDetail > DiagnosticDetails
Owning collection of diagnostic details with stable insertion order.
Definition Diagnostic.h:88
@ ProcgenGroupDataInvalid
Mesh group sidecar data is inconsistent with its dense streams.
@ HashMismatch
@ InvalidArgument
@ TypeMismatch
A stable reference resolved to a different canonical domain type.
@ DialogueRouteNotFound
A requested dialogue route does not exist on the current node.
@ NotFound
@ UnknownVersion
@ DialogueNotWaitingForChoice
Dialogue runner is not positioned at a choice suspension point.
@ SerializationError
@ CallbackFailure
@ DialogueConditionRejected
A dialogue condition rejected the requested route.
@ PreconditionViolation
@ AlreadyExists
@ DialogueNotWaitingForCommand
Dialogue runner is not positioned at an asynchronous command.
@ Cancelled
@ Unsupported
@ InvariantViolation
@ Failed
@ ParseError
@ StaleHandle
@ Conflict
std::ostream & operator<<(std::ostream &stream, Severity severity)
Writes a severity for diagnostics and test output.
Definition Diagnostic.h:39
constexpr std::string_view severityName(Severity severity) noexcept
Returns the stable lowercase severity spelling.
Definition Diagnostic.h:28
std::pair< std::string, std::string > DiagnosticDetail
A structured detail attached to a Diagnostic.
Definition Diagnostic.h:85
@ Warning
@ Info
@ Fatal
@ Error
constexpr std::string_view diagnosticCodeName(DiagnosticCode code) noexcept
Return a stable, compact spelling useful for logs and diagnostics.
Definition Diagnostic.h:176
Definition Container.h:602