logging

Enables and configures HTTP request/response logging.

Logging is disabled by default — by design, nothing is logged unless this method is called. Any number of sanitizeHeader predicates can be added; the Authorization header is always redacted regardless of the configured predicates.

Calling this method multiple times keeps the same LoggingConfig and applies each block on top of the previous state.

Example:

val client = DeepSeekClient("token") {
logging {
level = LogLevel.BODY
sanitizeHeader { header -> header == "Cookie" }
}
}

Return

This builder for chaining

Parameters

block

Configuration block receiving a LoggingConfig