Logging
SwiftSonic does not log anything by default. No print, no os_log, no Logger. If you embed it in a production app, it stays silent.
When you need to debug a request flow, you opt in by passing a logging hook through ServerConfiguration.
Opting in
Section titled “Opting in”TODO: confirm the exact logging API in 0.6.x. The shape is likely either a closure (
(LogEvent) -> Void) or aLoggerprotocol. Verify againstSources/SwiftSonic/Logging/(or wherever it lives).
// TODO: replace with verified shapelet config = ServerConfiguration( host: "music.example.com", username: "user", password: "pass", logger: { event in print(event) })What gets logged
Section titled “What gets logged”TODO: enumerate the log events emitted (request started, response received, retry attempted, error classified) once verified.
What is not logged
Section titled “What is not logged”Sensitive values are scrubbed: the password never appears in logs, and tokens are redacted. URLs may include the username component (u=...) — treat logs as you would any production access log.
TODO: confirm the redaction guarantees and which fields are scrubbed.