AppleSuspensionDiagnostics

Bounded, process-local observations for investigating suspension with shared files open.

This writes directly to Apple's unified log, never through a file logger. Labels use a closed vocabulary; callers must not pass paths, SQL, account identities or exception messages. Unknown labels become other. Database spans measure API operations, not SQLite VFS locks. A lifecycle stage does not establish that the process may execute, that it has suspended, or that its files are safe for suspension. Delivery is best effort.

Functions

Link copied to clipboard
fun abandoned(token: Long)

Retire an unsuccessful attempt on a descriptor that stays open. Never clears HELD or UNKNOWN.

Link copied to clipboard
fun acquired(token: Long, result: Int, error: Int = 0)

POSIX result zero means acquired; a failed attempt never establishes ownership.

Link copied to clipboard
fun beginDatabaseOperation(databaseKind: String, operation: String): Long
Link copied to clipboard
fun beginLock(kind: String, operation: String, descriptor: Int = -1): Long
Link copied to clipboard
fun closed(token: Long, result: Int, error: Int = 0)

A failed or interrupted close leaves UNKNOWN; callers must not retry close for diagnostics.

Link copied to clipboard
fun endDatabaseOperation(token: Long, outcome: String)
Link copied to clipboard
fun setBackgrounded(backgrounded: Boolean)
Link copied to clipboard
fun snapshot(stage: String)
Link copied to clipboard
fun unlocked(token: Long, result: Int, error: Int = 0)