Skip to content

Commit 45fbdb9

Browse files
committed
[lldb] Make the system log a NOOP on non-Darwin platforms
As discussed in llvm#111911, we have consensus that as it stands, the system log is only meaningful on Darwin and that by default it should be a NOOP on other platforms. (cherry picked from commit cc13d4f)
1 parent 26fe885 commit 45fbdb9

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

lldb/source/Host/common/Host.cpp

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,31 +89,12 @@ using namespace lldb;
8989
using namespace lldb_private;
9090

9191
#if !defined(__APPLE__)
92-
#if !defined(_WIN32)
93-
#include <syslog.h>
94-
void Host::SystemLog(Severity severity, llvm::StringRef message) {
95-
static llvm::once_flag g_openlog_once;
96-
llvm::call_once(g_openlog_once, [] {
97-
openlog("lldb", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_USER);
98-
});
99-
int level = LOG_DEBUG;
100-
switch (severity) {
101-
case lldb::eSeverityInfo:
102-
level = LOG_INFO;
103-
break;
104-
case lldb::eSeverityWarning:
105-
level = LOG_WARNING;
106-
break;
107-
case lldb::eSeverityError:
108-
level = LOG_ERR;
109-
break;
110-
}
111-
syslog(level, "%s", message.data());
112-
}
113-
#else
92+
// The system log is currently only meaningful on Darwin, where this means
93+
// os_log. The meaning of a "system log" isn't as clear on other platforms, and
94+
// therefore we don't providate a default implementation. Vendors are free to
95+
// to implement this function if they have a use for it.
11496
void Host::SystemLog(Severity severity, llvm::StringRef message) {}
11597
#endif
116-
#endif
11798

11899
#if !defined(__APPLE__) && !defined(_WIN32)
119100
static thread_result_t

0 commit comments

Comments
 (0)