@@ -170,14 +170,19 @@ std::recursive_mutex g_log_mutex;
170
170
171
171
// / Similar to LLDB_LOG, but with richer contextual information.
172
172
#define LOG_PRINTF (CHANNEL, FMT, ...) \
173
+ LOG_PRINTF_IMPL (CHANNEL, false , FMT, ##__VA_ARGS__)
174
+ #define LOG_VERBOSE_PRINTF (CHANNEL, FMT, ...) \
175
+ LOG_PRINTF_IMPL (CHANNEL, true , FMT, ##__VA_ARGS__)
176
+ #define LOG_PRINTF_IMPL (CHANNEL, VERBOSE, FMT, ...) \
173
177
do { \
174
- if (Log *log = lldb_private::GetLogIfAllCategoriesSet (CHANNEL)) { \
175
- std::lock_guard<std::recursive_mutex> locker (g_log_mutex); \
176
- /* The format string is optimized for code size, not speed. */ \
177
- log->Printf (" %s::%s%s" FMT, m_description.c_str (), \
178
- IsLambda (__FUNCTION__) ? " " : __FUNCTION__, \
179
- (FMT && FMT[0 ] == ' (' ) ? " " : " () -- " , ##__VA_ARGS__); \
180
- } \
178
+ if (Log *log = lldb_private::GetLogIfAllCategoriesSet (CHANNEL)) \
179
+ if (!(VERBOSE) || log->GetVerbose ()) { \
180
+ std::lock_guard<std::recursive_mutex> locker (g_log_mutex); \
181
+ /* The format string is optimized for code size, not speed. */ \
182
+ log->Printf (" %s::%s%s" FMT, m_description.c_str (), \
183
+ IsLambda (__FUNCTION__) ? " " : __FUNCTION__, \
184
+ (FMT && FMT[0 ] == ' (' ) ? " " : " () -- " , ##__VA_ARGS__); \
185
+ } \
181
186
} while (0 )
182
187
183
188
using namespace lldb ;
@@ -2067,10 +2072,9 @@ ProcessModule(ModuleSP &&module_sp, std::string m_description,
2067
2072
framework_search_paths.push_back ({fwsp.Path , fwsp.IsSystem });
2068
2073
for (const std::string &arg : ast_context->GetClangArguments ()) {
2069
2074
extra_clang_args.push_back (arg);
2070
- if (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TARGET))
2071
- LOG_PRINTF (LIBLLDB_LOG_TYPES,
2072
- " ProcessModule(\" %s\" ) adding Clang argument \" %s\" ." ,
2073
- module_file.GetFilename ().AsCString (" " ), arg.c_str ());
2075
+ LOG_VERBOSE_PRINTF (LIBLLDB_LOG_TYPES,
2076
+ " ProcessModule(\" %s\" ) adding Clang argument \" %s\" ." ,
2077
+ module_file.GetFilename ().AsCString (" " ), arg.c_str ());
2074
2078
}
2075
2079
}
2076
2080
}
0 commit comments