summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unicode.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-01-18 11:00:26 +0000
committerPavel Labath <labath@google.com>2017-01-18 11:00:26 +0000
commit107d9bbd6c7280959556da864c0c67dc9d951e14 (patch)
tree43ca304e71c4d51f4e243861af30a7f36a16a68f /llvm/lib/Support/Unicode.cpp
parentee6d7186c3c7b154cce0c3cfb5e234db8de5c277 (diff)
downloadbcm5719-llvm-107d9bbd6c7280959556da864c0c67dc9d951e14.tar.gz
bcm5719-llvm-107d9bbd6c7280959556da864c0c67dc9d951e14.zip
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
Diffstat (limited to 'llvm/lib/Support/Unicode.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud