MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / AndroidLogcatBuf

Method AndroidLogcatBuf

layersvt/api_dump.h:328–333  ·  view source on GitHub ↗

bufsize should be smaller than 0x400, because `__android_log_print` uses `vsnprintf` with a 1024 buffer size. If bufsize here is greater or close to 1024, the log will be truncated.

Source from the content-addressed store, hash-verified

326 // bufsize should be smaller than 0x400, because `__android_log_print` uses `vsnprintf` with a 1024 buffer size. If bufsize here
327 // is greater or close to 1024, the log will be truncated.
328 AndroidLogcatBuf(std::unique_ptr<LogWriter> log_writer, size_t bufsize = 0x200)
329 : buffer_(std::make_unique<char_type[]>(bufsize)), bufsize_(bufsize), log_writer_(std::move(log_writer)) {
330 // We use the last position of buffer_ to store the overflow character. We use 0 as a sentinel element to indicate if this
331 // overflow slot is in use.
332 this->setp(buffer_.get(), buffer_.get() + bufsize_ - 1);
333 }
334 ~AndroidLogcatBuf() = default;
335
336 private:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected