create

fun create(bufferBytes: Int = DEFAULT_BUFFER_BYTES, appendedTags: (tag: String) -> Boolean = { false }): LogsDebugTab

Creates a LogsDebugTab.

Parameters

bufferBytes

the most memory that the held lines may take, by the size of their text on the heap (two bytes a character) and a fixed cost for each line. When a new line goes over it, the oldest lines go. The default, DEFAULT_BUFFER_BYTES, holds about 12,000 lines of 100 characters.

appendedTags

whether the app's logger also gives the lines of a tag to append. The tab then drops the logcat lines of that tag, so that each line shows once, in full: the lines from the first append of the tag on. The older lines of the tag come from logcat, cut, because the logger could not append them yet, for example when the app gives the logger the tab after it creates the tab. So no line is lost, and a tag that the logger never appends keeps all its logcat lines. When the logger writes a line to logcat before it appends it, the first line of a tag can show twice: as the cut copies from logcat and as the appended line. For a fixed set of tags, pass setOf("A", "B")::contains. append calls it on the logger's thread, for each line of a tag that it has not taken yet, so keep it fast. A line that it logs through the logger while it runs does not call it again. When it throws, the tab keeps the logcat lines of the tag. The default drops no line.

Throws