================
@@ -89,8 +89,17 @@ using namespace lldb;
 using namespace lldb_private;
 
 #if !defined(__APPLE__)
+#if !defined(_WIN32)
+#include <syslog.h>
+void Host::SystemLog(llvm::StringRef message) {
+  openlog("lldb", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_USER);
+  syslog(LOG_INFO, "%s", message.data());
+  closelog();
----------------
JDevlieghere wrote:

Thanks Jordan. I've moved the `openlog` behind a `call_once` flag and omitted 
the `closelog`. 

I considered executing `syslog` on the debugger's thread pool but the fact that 
Core depends on Host means that would be a layering violation and there's no 
good place to manage the futures something like `std::async` would return. 

Right now the system log function is only used for the corresponding log 
handler which is purely opt-in. I do plan to use it in other places (e.g. the 
debugger diagnostics) but even then I expect it to be relatively low traffic. 

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

Reply via email to