zturner added a comment.

A couple comments:

1. If we're going to use `formatv` (yay!) then let's standardize.  No point 
mising `formatv` and streaming, especially when the former will almost always 
be less verbose.

2. One of the concerns that came up last time was that of evaluating the 
arguments to the logging functions even in the case where it didn't get logged, 
because sometimes just calling the function to evaluate the parameter can be 
expensive.  To get around that you could pass the arguments directly to the 
macro instead of streaming them, and the macro could wrap everything in a 
lambda.

Combining #1 and #2 above, maybe you end up with something like this (not 
tested, probably needs some tweaking to work):

  #define LLDB_LOG(...) LLDB_LOG_([]() { return llvm::formatv(__VA_ARGS__); }
  
  LLDB_LOG("pid = {0}: tracking new thread tid {1}", GetID(), tid);


https://reviews.llvm.org/D27459



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to