Skip to content

Commit 4fee9a7

Browse files
committed
wrap in LLDB_ENABLE_SWIFT
1 parent f6faf0c commit 4fee9a7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lldb/include/lldb/Utility/Logging.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
LIBLLDB_LOG_STATE | LIBLLDB_LOG_SYMBOLS | LIBLLDB_LOG_TARGET | \
5151
LIBLLDB_LOG_COMMANDS)
5252

53+
#ifdef LLDB_ENABLE_SWIFT
5354
#define LIBLLDB_SWIFT_LOG_HEALTH (1u << 1)
55+
#endif
5456

5557
namespace lldb_private {
5658

lldb/source/Utility/Logging.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,23 @@ static constexpr Log::Category g_categories[] = {
4949
{{"watch"}, {"log watchpoint related activities"}, LIBLLDB_LOG_WATCHPOINTS},
5050
};
5151

52+
static Log::Channel g_log_channel(g_categories, LIBLLDB_LOG_DEFAULT);
53+
54+
#ifdef LLDB_ENABLE_SWIFT
55+
5256
static constexpr Log::Category g_swift_categories[] = {
5357
{{"health"}, {"log all messages related to lldb Swift operational health"}, LIBLLDB_SWIFT_LOG_HEALTH},
5458
};
5559

56-
static Log::Channel g_log_channel(g_categories, LIBLLDB_LOG_DEFAULT);
5760
static Log::Channel g_swift_log_channel(g_swift_categories, LIBLLDB_SWIFT_LOG_HEALTH);
5861

62+
#endif
63+
5964
void lldb_private::InitializeLldbChannel() {
6065
Log::Register("lldb", g_log_channel);
66+
#ifdef LLDB_ENABLE_SWIFT
6167
Log::Register("swift", g_swift_log_channel);
68+
#endif
6269
}
6370

6471
Log *lldb_private::GetLogIfAllCategoriesSet(uint32_t mask) {
@@ -69,6 +76,8 @@ Log *lldb_private::GetLogIfAnyCategoriesSet(uint32_t mask) {
6976
return g_log_channel.GetLogIfAny(mask);
7077
}
7178

79+
#ifdef LLDB_ENABLE_SWIFT
7280
Log *lldb_private::GetSwiftHealthLog() {
7381
return g_swift_log_channel.GetLogIfAny(LIBLLDB_SWIFT_LOG_HEALTH);
7482
}
83+
#endif

0 commit comments

Comments
 (0)