From 9ffada31a8cceff2dda4b62cceb4820b5eea60e6 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 12 May 2023 09:19:44 +0200 Subject: [PATCH] Swift: make internal error telemetry only for the moment --- swift/logging/SwiftDiagnostics.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/swift/logging/SwiftDiagnostics.h b/swift/logging/SwiftDiagnostics.h index 8c7117f26ce..6e539b0330b 100644 --- a/swift/logging/SwiftDiagnostics.h +++ b/swift/logging/SwiftDiagnostics.h @@ -54,6 +54,16 @@ struct SwiftDiagnostic { std::optional location{}; + constexpr SwiftDiagnostic(std::string_view id, + std::string_view name, + std::string_view action = "", + std::string_view helpLinks = "", + Visibility visibility = Visibility::all) + : id{id}, name{name}, action{action}, helpLinks{helpLinks}, visibility{visibility} {} + + constexpr SwiftDiagnostic(std::string_view id, std::string_view name, Visibility visibility) + : SwiftDiagnostic(id, name, "", "", visibility) {} + // create a JSON diagnostics for this source with the given timestamp and message to out // A plaintextMessage is used that includes both the message and the action to take. Dots are // appended to both. The id is used to construct the source id in the form @@ -93,6 +103,6 @@ inline constexpr SwiftDiagnostic::Visibility operator&(SwiftDiagnostic::Visibili constexpr SwiftDiagnostic internalError{ "internal-error", "Internal error", - "Contact us about this issue", + SwiftDiagnostic::Visibility::telemetry, }; } // namespace codeql