[Lldb-commits] [lldb] [lldb] Log errors to the system log if they would otherwise get dropped (PR #111911)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 11 00:02:54 PDT 2024


https://github.com/labath commented:

So, I have a couple of thoughts:
- the system log currently writes to stdout on windows. This was sort of okay, when we were writing there only sporadically, but I think piping all of that here would make lldb unusable. If we want to go down this path, I think we should make `Host::SystemLog` a noop on windows (until someone comes up with a better implementation)
- I guess this is fine, though I am somewhat worried about the amount of output that this will generate. Like, I'm not sure if all of these errors really rise to the level that needs this kind of error reporting (it could be an "expected" error that is somehow retried/corrected at a higher level). I don't have a good intuition for this, but I know that personally, I was using LLDB_LOG_ERROR very liberally. I think I'll show more restraint after this.
- Nonetheless I think it would be good to have some way to opt out of this behavior -- if we find that some low level log statement is generating too much output. Maybe we could draw the line at the verbose log (LLDB_LOG_ERRORV)? After all, if something is a "verbose log message" then it probably doesn't contain "high-value information" that's supposed to be "used sparsely and deliberately". (Although, to be honest, even limiting this to `LLDB_LOG_ERROR` doesn't exactly sound like sparse and deliberate use to me)

https://github.com/llvm/llvm-project/pull/111911


More information about the lldb-commits mailing list