[Lldb-commits] [PATCH] D127986: [lldb] Support a buffered logging mode

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 16 13:37:34 PDT 2022


clayborg added a comment.

For this idea to work we would need to change the Emit() function to be DoEmit(...), then add logic to LogHandler:

  void LogHandler::Emit(StringRef message) {
    if (m_circular) {
      // Fill buffer in circular fashion
      return;
    }
    if (m_buffer_size > 0) {
      if (m_buffer.size() + message.size() > m_buffer_size) {
        // If we exceed the buffer size, flush.
        DoEmit(m_buffer);
        DoEmit(message);
        m_buffer.clear();
      } else {
        // Buffer size not exceeded yet.
        m_buffer += message.str();
      }
    } else {
      DoEmit(message); 
    }
  }


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

https://reviews.llvm.org/D127986



More information about the lldb-commits mailing list