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

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 23 00:38:44 PDT 2022


labath added a comment.

In D128321#3603007 <https://reviews.llvm.org/D128321#3603007>, @JDevlieghere wrote:

> In D128321#3602129 <https://reviews.llvm.org/D128321#3602129>, @clayborg wrote:
>
>> I think we should allow this class to always exist and not conditionally compile it in or out. Then we add a new Host.h method to emit a log message in "lldb/Host/Host.h" and allow each host OS to emit a message. Maybe there is a default implementation that emits the message to stderr, and then we override this for in HostInfoMacOSX.h? Then each OS can use their OS logging API of choice.
>
> Yeah, I considered that, but that would make Utility depend on Host which would (re)introduce the circular dependency between the two. The alternative would be to still make the class available unconditionally, but use target ifdefs to have different implementations.

We already have `Host::SystemLog`. Could we use that? Or change it so that it can be used?

As for the dependencies, I think we could structure things such that the SystemLogHandler lives in the Host module, and the general logging infrastructure is not aware of it. (The only one who would know about it would be the `log enable` command, which would pass it down as a generic reference.)


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

https://reviews.llvm.org/D128321



More information about the lldb-commits mailing list