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.
| 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: |
nothing calls this directly
no outgoing calls
no test coverage detected