This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add RotatingLogHandler
ClosedPublic

Authored by JDevlieghere on Jun 15 2022, 10:41 PM.

Details

Summary

Add a log handler that maintains a circular buffer.

Diff Detail

Event Timeline

JDevlieghere created this revision.Jun 15 2022, 10:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 10:41 PM
kastiglione added inline comments.Jun 16 2022, 11:08 AM
lldb/include/lldb/Utility/Log.h
98

this could be an array, since it's not being dynamically resized.

  • Use dynamic array instead of vector.
  • Rebase
kastiglione accepted this revision.Jun 16 2022, 2:26 PM

lgtm

lldb/unittests/Utility/LogTest.cpp
115

minor: return buffer;

This revision is now accepted and ready to land.Jun 16 2022, 2:26 PM
JDevlieghere marked an inline comment as done.Jun 16 2022, 2:42 PM
JDevlieghere added inline comments.
lldb/unittests/Utility/LogTest.cpp
115

I did that on purpose to avoid the call to flush but looking at the raw_string_ostream the stream is unbuffered and str doesn't even call flush under the hood. TIL.

This revision was landed with ongoing or failed builds.Jun 16 2022, 3:17 PM
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2022, 3:17 PM