summaryrefslogtreecommitdiff
path: root/log.cpp
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-08-27 21:52:48 -0700
committerMark Rowe <mark@vector35.com>2025-09-02 18:58:49 -0700
commit837049b5534bc3dc6cbe83b136e514fd72602e42 (patch)
treef3f249d797c402fab401a3354abd27f0cd70f312 /log.cpp
parent82a858d3be86d4e701cf8e2ebdc31c8d70237dd6 (diff)
Introduce a new define to control LogTrace rather than using _DEBUG
Defining `_DEBUG` changes which MSVC runtime library needs to be linked which breaks clients attempting to use the C++ API with `RelWithDebInfo`. To fix this we define a new private `BN_ENABLE_LOG_TRACE` macro and use that within log.cpp where it was previously using `_DEBUG`. Fixes https://github.com/Vector35/binaryninja-api/issues/7288.
Diffstat (limited to 'log.cpp')
-rw-r--r--log.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/log.cpp b/log.cpp
index 2329e503..e6abe48b 100644
--- a/log.cpp
+++ b/log.cpp
@@ -215,7 +215,7 @@ void BinaryNinja::Log(BNLogLevel level, const char* fmt, ...)
void BinaryNinja::LogTrace(const char* fmt, ...)
{
-#ifdef _DEBUG
+#ifdef BN_ENABLE_LOG_TRACE
va_list args;
va_start(args, fmt);
PerformLog(0, DebugLog, "", 0, fmt, args);
@@ -280,7 +280,7 @@ void BinaryNinja::LogForException(BNLogLevel level, const std::exception& e, con
void BinaryNinja::LogTraceForException(const std::exception& e, const char* fmt, ...)
{
-#ifdef _DEBUG
+#ifdef BN_ENABLE_LOG_TRACE
va_list args;
va_start(args, fmt);
PerformLogForException(0, DebugLog, "", 0, e, fmt, args);
@@ -345,12 +345,12 @@ void BinaryNinja::LogWithStackTrace(BNLogLevel level, const char* fmt, ...)
void BinaryNinja::LogTraceWithStackTrace(const char* fmt, ...)
{
- #ifdef _DEBUG
+#ifdef BN_ENABLE_LOG_TRACE
va_list args;
va_start(args, fmt);
PerformLogWithStackTrace(0, DebugLog, "", 0, fmt, args);
va_end(args);
- #endif
+#endif
}
@@ -493,7 +493,7 @@ void Logger::Log(BNLogLevel level, const char* fmt, ...)
void Logger::LogTrace(const char* fmt, ...)
{
-#ifdef _DEBUG
+#ifdef BN_ENABLE_LOG_TRACE
va_list args;
va_start(args, fmt);
PerformLog(GetSessionId(), DebugLog, GetName(), GetThreadId(), fmt::format("{}{}", GetIndent(), fmt).c_str(), args);
@@ -559,7 +559,7 @@ void Logger::LogForException(BNLogLevel level, const std::exception& e, const ch
void Logger::LogTraceForException(const std::exception& e, const char* fmt, ...)
{
-#ifdef _DEBUG
+#ifdef BN_ENABLE_LOG_TRACE
va_list args;
va_start(args, fmt);
PerformLogForException(
@@ -631,13 +631,13 @@ void Logger::LogWithStackTrace(BNLogLevel level, const char* fmt, ...)
void Logger::LogTraceWithStackTrace(const char* fmt, ...)
{
- #ifdef _DEBUG
+#ifdef BN_ENABLE_LOG_TRACE
va_list args;
va_start(args, fmt);
PerformLogWithStackTrace(
GetSessionId(), DebugLog, GetName(), GetThreadId(), fmt::format("{}{}", GetIndent(), fmt).c_str(), args);
va_end(args);
- #endif
+#endif
}