llvm-project/lldb/tools/lldb-server
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
..
Darwin/resources [NFC] Darwin llgs support from Week of Code 2016-09-04 00:18:56 +00:00
Acceptor.cpp Fix remote-linux regression due to stringRef changes 2016-11-21 15:18:58 +00:00
Acceptor.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CMakeLists.txt [cmake] Make lldb build with the android ndk toolchain file 2017-01-17 11:55:00 +00:00
LLDBServerUtilities.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
LLDBServerUtilities.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lldb-gdbserver.cpp Add a more succinct logging syntax 2017-01-18 11:00:26 +00:00
lldb-platform.cpp Introduce chrono to more gdb-remote functions 2016-11-24 10:54:49 +00:00
lldb-server.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
lldb-server.exports Only export public symbols with the cmake build. 2015-09-04 00:00:41 +00:00