[Lldb-commits] [PATCH] D148399: [lldb] Improve logging for process state change (NFC)

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 20 13:16:34 PDT 2023


mib added a comment.

In D148399#4284809 <https://reviews.llvm.org/D148399#4284809>, @bulbazord wrote:

> We'd go from:
>
>   LLDB_LOGF(log,
>             "Process::SetPrivateState (plugin = %s, state = %s) state didn't "
>             "change. Ignoring...",
>             GetPluginName().data(), StateAsCString(new_state));
>
> to
>
>   LLDB_LOG(log, "(plugin = %s, state = %s) state didn't "
>             "change. Ignoring...",
>             GetPluginName().data(), StateAsCString(new_state));
>
> `LLDB_LOG` automatically inserts the file and func into the log. There are plenty of places where we copy/paste logs like these into other files without remembering to update this piece of information, so removing it from the log line entirely helps prevent those kinds of issues in the future. It's a minor thing, but if the point of this patch is to improve the logging mechanism entirely, then I think we should also think about these kinds of things. See 0a74fbb7b1d3e04ac03389f1fc455ac593c2e5ee <https://reviews.llvm.org/rG0a74fbb7b1d3e04ac03389f1fc455ac593c2e5ee> for an example of what I mean.

I didn't understand that originally (since what you guys are suggesting doesn't have anything to do with my change), but I'll update it in this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148399/new/

https://reviews.llvm.org/D148399



More information about the lldb-commits mailing list