TraceAPI

interface TraceAPI(source)

trace 的管理 API,仅支持管理,包括读取和删除。

See also

Functions

Link copied to clipboard
abstract suspend fun count(origin: String, namespace: KebabCase): Int

获取指定记录者指定命名空间下所有条目的总数。

Link copied to clipboard
abstract suspend fun entries(origin: String, namespace: KebabCase, range: UIntRange): List<Instant>

列出指定记录者指定命名空间下的条目的时间戳。

Link copied to clipboard
abstract suspend fun get(origin: String, namespace: KebabCase, timestamp: Instant): String?

获取指定记录者指定命名空间下指定时间戳的条目。trace 条目可能较大,请妥善处理。

Link copied to clipboard
abstract suspend fun namespaces(origin: String): List<KebabCase>

列出指定记录者的所有命名空间。

Link copied to clipboard
abstract suspend fun origins(): List<String>

列出所有记录者的 id,id 是记录者的 KClass.java.name

Link copied to clipboard
abstract suspend fun remove(origin: String, namespace: KebabCase, timestamp: Instant): Boolean

删除指定记录者指定命名空间下指定时间戳的条目。