[Lldb-commits] [lldb] [lldb] Add TeeLogHandler to log to 2 handlers (PR #90984)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Fri May 3 11:03:06 PDT 2024
================
@@ -438,3 +439,15 @@ void RotatingLogHandler::Dump(llvm::raw_ostream &stream) const {
}
stream.flush();
}
+
+TeeLogHandler::TeeLogHandler(std::shared_ptr<LogHandler> first_log_handler,
+ std::shared_ptr<LogHandler> second_log_handler)
+ : m_first_log_handler(first_log_handler),
+ m_second_log_handler(second_log_handler) {}
+
+void TeeLogHandler::Emit(llvm::StringRef message) {
+ if (m_first_log_handler)
----------------
JDevlieghere wrote:
No, it's just being resilient agains the shared_ptrs being null. The alternative would be an assert in the ctor. Let me know if you prefer that? It would be slightly more efficient.
https://github.com/llvm/llvm-project/pull/90984
More information about the lldb-commits
mailing list