append

fun append(priority: Int, tag: String, message: String, throwable: Throwable? = null)

Adds a line that the app's own logger writes, with its whole text, to the lines from logcat. The console, GET entries, and GET text show it as one line, with the time, the process, and the thread of this call.

The text is message and, after a line break, the stack trace of throwable, as Log.e(tag, message, throwable) writes them. It keeps at most MAX_APPENDED_CHARS characters and, in a small buffer, at most the characters that take an eighth of bufferBytes, so that one line can't empty the buffer. A longer text ends with … cut (N more characters).

When appendedTags of create takes tag, the first call for the tag starts the drop of its logcat lines.

Safe to call from any thread, also before Lustro.start() and after Lustro.stop(). It does not write to logcat: the logger does that itself, when it does. The line goes to the buffer at once. A logcat line goes in when the reader reads it: usually some milliseconds after it was written, but much later at the app's start, when the reader first reads the lines of the process from its start, and after a stop and a start. So the buffer can hold an appended line before logcat lines that are older, and the times of the lines are not always in order.

Parameters

priority

the level, as an android.util.Log priority, such as Log.DEBUG. Log.ASSERT shows as F, as in logcat.