Skip to content

Commit

Permalink
Only enable verbose callback if debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
2bc4 committed Dec 29, 2023
1 parent ee5dd26 commit 32b069c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ impl fmt::Display for Error {
}

fn init_curl<T: Write>(handle: &mut Easy2<RequestHandler<T>>, url: &Url) -> Result<()> {
handle.verbose(true)?;
if log::max_level() == log::LevelFilter::Debug {
handle.verbose(true)?;
}

handle.tcp_nodelay(true)?;
handle.useragent(constants::USER_AGENT)?;
handle.url(url.as_ref())?;
Expand Down

0 comments on commit 32b069c

Please sign in to comment.