载入中...
搜索中...
未找到
Diagnostic.cpp
浏览该文件的文档.
7std::ostream& operator<<(std::ostream& stream, Severity severity) { return stream << severityName(severity); }
9std::ostream& operator<<(std::ostream& stream, DiagnosticCode code) { return stream << diagnosticCodeName(code); }
18Diagnostic::Diagnostic(DiagnosticCode code, Severity severity, std::string message, std::string path)
28Diagnostic::Diagnostic(DiagnosticCode code, Severity severity, std::string message, std::string path,
37Diagnostic Diagnostic::error(DiagnosticCode code, std::string message, std::string path, DiagnosticDetails details,
39 return Diagnostic(code, Severity::Error, std::move(message), std::move(path), std::move(details),
42Diagnostic Diagnostic::warning(DiagnosticCode code, std::string message, std::string path, DiagnosticDetails details,
44 return Diagnostic(code, Severity::Warning, std::move(message), std::move(path), std::move(details),
Stable, structured diagnostics shared by engine modules.
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
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
void addDetail(std::string key, std::string value)
Add structured context without changing the stable code.
Definition Diagnostic.cpp:47
static Diagnostic warning(DiagnosticCode code, std::string message, std::string path={})
Construct a warning diagnostic.
Definition Diagnostic.cpp:24
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
std::ostream & operator<<(std::ostream &stream, Severity severity)
Writes a severity for diagnostics and test output.
Definition Diagnostic.cpp:7
constexpr std::string_view severityName(Severity severity) noexcept
Returns the stable lowercase severity spelling.
Definition Diagnostic.h:28
@ Warning
@ 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