[Lldb-commits] [PATCH] D135621: [lldb] Add an always-on log channel

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 11 11:20:17 PDT 2022


clayborg added a comment.

Maybe use LLDBLog::Diagnostics instead of LLDBLog::AlwaysOn? and maybe "diagnostics" instead of "always-on"?

I am also questioning if the these even belong in the LLDB logging stuff? Seems like it would be just as easy to create a diagnostic message by calling Diagnostics::Report(...). Do we really want to modify the log channels here? Seems like always on diagnostics should just a dedicated API.

It might be nice to also have a "diagnostics" log channel that _can_ be enabled, and any diagnostic messages would then also be included in the log output but only if enabled by the user?



================
Comment at: lldb/include/lldb/Utility/Diagnostics.h:49
   static llvm::Optional<Diagnostics> &InstanceImpl();
+  static const size_t g_log_messages;
+
----------------
Move out of header file as a file static only? Better name might be a good idea. "g_log_messages" sounds like a boolean setting. Maybe "g_max_log_messages" or "g_num_log_messages"?


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

https://reviews.llvm.org/D135621



More information about the lldb-commits mailing list