Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d4c12038 authored by Evan Laird's avatar Evan Laird
Browse files

[Sb refactor] Add local logcat echoing to TableLogBuffer

TableLogBuffer is a sibling of LogBuffer, so it needs to reimplement the
desirable behaviors of Logbuffer. In this CL, we're adding support for
local logcat echoing on every table. The logging happens only in the
background and can fail silently so that it never blocks the main
thread.

This implementation differs from the LogBuffer implementation which was
written before the coroutines library was available, so it doesn't use
a background thread-per-table like the LogBuffer implementation does.
Rather, this implementation uses a Channel + a background
CoroutineDispatcher to execute all logging in the background.

We do leverage the existing LogcatEchoTracker class, which implements a
generic settings listener + settings format for turning logcat echoing
on at the buffer or tag level. In our case, the buffer name is the name
of the table, and the tags are the column names.

Note that all TableLogBuffer logs are considered to be `LogLevel.DEBUG`
since the API for `logChange` does not let the caller decide on a log
level. Arguably this makes perfect sense since table logs are _not_
meant to be warning or error logs. We could probably make the case that
they are `info` or `verbose`, but that would be immaterial to this
overall change.

Test: existing tests in tests/src/com/android/systemui/statusbar/pipelinestyle
Test: TableLogBufferTest
Test: manual
Bug: 255951648
Change-Id: I930e4c7730117860ab22e8849c84f1f96f786b30
parent 66c3f036
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment