llvm-project/lldb/tools
Pavel Labath 107d9bbd6c Add a more succinct logging syntax
This adds the LLDB_LOG macro, which enables one to write more succinct log
statements.
if (log)
  log->Printf("log something: %d", var);
becomes
LLDB_LOG(log, "log something: {0}, var);

The macro still internally does the "if(log)" dance, so the arguments are only
evaluated if logging is enabled, meaning it has the same overhead as the
previous syntax.

Additionally, the log statements will be automatically prefixed with the file
and function generating the log (if the corresponding new argument to the "log
enable" command is enabled), so one does not need to manually specify this in
the log statement.

It also uses the new llvm formatv syntax, which means we don't have to worry
about PRIx64 macros and similar, and we can log complex object (llvm::StringRef,
lldb_private::Error, ...) more easily.

Differential Revision: https://reviews.llvm.org/D27459

llvm-svn: 292360
2017-01-18 11:00:26 +00:00
..
argdumper [CMake] Refactor LLDB libraries and tools to be components 2016-12-15 22:01:17 +00:00
compact-unwind *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
darwin-debug [CMake] Refactor LLDB libraries and tools to be components 2016-12-15 22:01:17 +00:00
darwin-threads *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
debugserver Revert part of cleanup to fix a build break 2017-01-06 01:42:56 +00:00
driver Another windows build fix 2017-01-06 13:07:09 +00:00
install-headers add back an Xcode-specific Makefile for header installation 2016-01-28 22:34:36 +00:00
lldb-mi [lldb-mi] Fix implementation for a few mi commands 2017-01-05 13:23:47 +00:00
lldb-perf Make lldb -Werror clean for -Wstring-conversion 2017-01-06 00:38:06 +00:00
lldb-server Add a more succinct logging syntax 2017-01-18 11:00:26 +00:00
CMakeLists.txt Clean up some use of __ANDROID_NDK__ in the cmake files 2016-12-05 11:15:36 +00:00