pub struct StderrTransportLogger { /* private fields */ }Expand description
Transport logger that prints a redacted, curl-style HTTP trace to stderr.
Outbound requests are prefixed with > and responses with <:
> POST https://api.example.com/v3/repos
> authorization: <redacted>
> content-type: application/json
>
> {"name":"foo"}
< 200 POST https://api.example.com/v3/repos
< content-type: application/json
<
< {"id":"repo-1"}Bodies are printed for JSON/decode paths; raw byte-download responses report
only their size. Sensitive header values (authorization,
proxy-authorization, cookie, set-cookie, x-api-key) are redacted.
Implementations§
Source§impl StderrTransportLogger
impl StderrTransportLogger
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a stderr transport logger that redacts the built-in sensitive header set.
Sourcepub fn with_redacted_headers(
self,
names: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_redacted_headers( self, names: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Adds header names to redact on top of the built-in set.
Use this for CLI-specific secret-bearing headers that are not standard
auth headers — for example a custom API-key header an auth injector sets.
Names are matched case-insensitively. Additive only: the built-in set
(authorization, proxy-authorization, cookie, set-cookie,
x-api-key) is always redacted. Names are trimmed and empty entries are
dropped, so a stray-whitespace config value cannot silently fail to
match (which would leak the header).
Trait Implementations§
Source§impl Clone for StderrTransportLogger
impl Clone for StderrTransportLogger
Source§fn clone(&self) -> StderrTransportLogger
fn clone(&self) -> StderrTransportLogger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more