[Lldb-commits] [lldb] [lldb] Add TeeLogHandler to log to 2 handlers (PR #90984)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Fri May 3 10:57:11 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)
----------------
adrian-prantl wrote:

Is the idea that one will ne optional in the typical use-case?

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


More information about the lldb-commits mailing list