[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)

2024-05-03 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere closed 
https://github.com/llvm/llvm-project/pull/90913
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)

2024-05-03 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/90913

>From 7ed4008b32d6ec7809a9cea0eb4462d1b90f4e52 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 2 May 2024 15:47:46 -0700
Subject: [PATCH] [lldb] Always emit diagnostic events to the system log

Always emit diagnostic events to the system log so that they end up in
the sysdiagnose on Darwin.
---
 lldb/source/Core/Debugger.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 065f70c3880aaa..976420a4344394 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1512,6 +1512,9 @@ void Debugger::ReportDiagnosticImpl(Severity severity, 
std::string message,
 std::optional debugger_id,
 std::once_flag *once) {
   auto ReportDiagnosticLambda = [&]() {
+// Always log diagnostics to the system log.
+Host::SystemLog(severity, message);
+
 // The diagnostic subsystem is optional but we still want to broadcast
 // events when it's disabled.
 if (Diagnostics::Enabled())

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)

2024-05-02 Thread Adrian Prantl via lldb-commits

https://github.com/adrian-prantl approved this pull request.


https://github.com/llvm/llvm-project/pull/90913
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)

2024-05-02 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben approved this pull request.

LGTM with comment

https://github.com/llvm/llvm-project/pull/90913
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)

2024-05-02 Thread Med Ismail Bennani via lldb-commits


@@ -1512,7 +1512,22 @@ void 
Debugger::ReportDiagnosticImpl(DiagnosticEventData::Type type,
 std::string message,
 std::optional debugger_id,
 std::once_flag *once) {
+  auto GetSystemLogLevel = [](DiagnosticEventData::Type type) {

medismailben wrote:

nit: This could be `constexpr` I think

https://github.com/llvm/llvm-project/pull/90913
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)

2024-05-02 Thread Med Ismail Bennani via lldb-commits

https://github.com/medismailben edited 
https://github.com/llvm/llvm-project/pull/90913
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)

2024-05-02 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)


Changes

Always emit diagnostic events to the system log so that they end up in the 
sysdiagnose on Darwin.

---
Full diff: https://github.com/llvm/llvm-project/pull/90913.diff


1 Files Affected:

- (modified) lldb/source/Core/Debugger.cpp (+15) 


``diff
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index cac4642873b772..c5ab99fac75d27 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1512,7 +1512,22 @@ void 
Debugger::ReportDiagnosticImpl(DiagnosticEventData::Type type,
 std::string message,
 std::optional debugger_id,
 std::once_flag *once) {
+  auto GetSystemLogLevel = [](DiagnosticEventData::Type type) {
+switch (type) {
+case DiagnosticEventData::Type::Info:
+  return Host::eSystemLogInfo;
+case DiagnosticEventData::Type::Warning:
+  return Host::eSystemLogWarning;
+case DiagnosticEventData::Type::Error:
+  return Host::eSystemLogError;
+}
+llvm_unreachable("All cases handled above!");
+  };
+
   auto ReportDiagnosticLambda = [&]() {
+// Always log diagnostics to the system log.
+Host::SystemLog(GetSystemLogLevel(type), message);
+
 // The diagnostic subsystem is optional but we still want to broadcast
 // events when it's disabled.
 if (Diagnostics::Enabled())

``




https://github.com/llvm/llvm-project/pull/90913
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Always emit diagnostic events to the system log (PR #90913)

2024-05-02 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/90913

Always emit diagnostic events to the system log so that they end up in the 
sysdiagnose on Darwin.

>From 458913020dd443c0ca92caa63cf8477035f8c5cc Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 2 May 2024 15:47:46 -0700
Subject: [PATCH] [lldb] Always emit diagnostic events to the system log

Always emit diagnostic events to the system log so that they end up in
the sysdiagnose on Darwin.
---
 lldb/source/Core/Debugger.cpp | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index cac4642873b772..c5ab99fac75d27 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1512,7 +1512,22 @@ void 
Debugger::ReportDiagnosticImpl(DiagnosticEventData::Type type,
 std::string message,
 std::optional debugger_id,
 std::once_flag *once) {
+  auto GetSystemLogLevel = [](DiagnosticEventData::Type type) {
+switch (type) {
+case DiagnosticEventData::Type::Info:
+  return Host::eSystemLogInfo;
+case DiagnosticEventData::Type::Warning:
+  return Host::eSystemLogWarning;
+case DiagnosticEventData::Type::Error:
+  return Host::eSystemLogError;
+}
+llvm_unreachable("All cases handled above!");
+  };
+
   auto ReportDiagnosticLambda = [&]() {
+// Always log diagnostics to the system log.
+Host::SystemLog(GetSystemLogLevel(type), message);
+
 // The diagnostic subsystem is optional but we still want to broadcast
 // events when it's disabled.
 if (Diagnostics::Enabled())

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits