[Lldb-commits] [PATCH] D27459: Straw-man proposal for new logging syntax

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 9 04:00:23 PST 2016


labath added a comment.

I'll respond to your comments on the lldb-dev thread.



================
Comment at: include/lldb/Core/Log.h:218-219
+          << llvm::formatv(                                                    \
+                 "{0,-60}: ",                                                   \
+                 (llvm::sys::path::filename(__FILE__) + "::" + __FUNCTION__)   \
+                     .str())                                                   \
----------------
clayborg wrote:
> This is hard coding in the file + line all the time. I would like this to be an option. We also need to be able to optionally enable the pid/tid, thread name, stack backtrace and all the other options that are currently supported by "log enable". Seems like we need a log function that exists in Log.cpp to take a log mutex, add the extra log prefix stuff (file + line, pid/tid, thread name, timestamp, delta since last log time, stack etc) and then call the llvm::formatv() one or more times and then release the mutex.
I am planning to make the source information optional. This diff is mainly here to demonstrate the target syntax from the users point of view. The changes are made here are not to be taken as examples of good coding practices - it is just the minimal set of changes I needed to do to make things work. When we agree on the final syntax, I'll implement this more nicely.


https://reviews.llvm.org/D27459





More information about the lldb-commits mailing list