[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 24 06:38:00 PDT 2022


labath added inline comments.


================
Comment at: lldb/source/Host/common/Host.cpp:110
+#if !defined(__APPLE__)
+void Host::SystemLog(const std::string &message) {
+  fprintf(stderr, "%s", message.c_str());
----------------
labath wrote:
> Why std::string? I'd expect StringRef (as that's what the LogHandler class uses), const char * (as that can avoid string copying sometimes) or a Twine (in case you want to be fancy), but a string seems like it combines the worst properties of all of these.
Actually, I think we should just use a StringRef and use llvm::errs() for printing.


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

https://reviews.llvm.org/D128321



More information about the lldb-commits mailing list