[Lldb-commits] [lldb] [lldb] Add a log level to Host::SystemLog (PR #90904)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Thu May 2 13:44:44 PDT 2024


================
@@ -91,15 +91,37 @@ using namespace lldb_private;
 #if !defined(__APPLE__)
 #if !defined(_WIN32)
 #include <syslog.h>
-void Host::SystemLog(llvm::StringRef message) {
+void Host::SystemLog(SystemLogLevel log_level, llvm::StringRef message) {
   static llvm::once_flag g_openlog_once;
   llvm::call_once(g_openlog_once, [] {
     openlog("lldb", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_USER);
   });
-  syslog(LOG_INFO, "%s", message.data());
+  int level = LOG_DEBUG;
+  switch (log_level) {
+  case eSystemLogInfo:
+    level = LOG_INFO;
+    break;
+  case eSystemLogWarning:
+    level = LOG_WARNING;
+    break;
+  case eSystemLogError:
+    level = LOG_WARNING;
----------------
medismailben wrote:

typo ?

https://github.com/llvm/llvm-project/pull/90904


More information about the lldb-commits mailing list