Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ Output logs to a file.
Same as `MISE_LOG_LEVEL` but for the log _file_ output level. This is useful if you want
to store the logs but not have them litter your display.

### `MISE_LOG_HTTP=1`

Display HTTP requests/responses in the logs.

### `MISE_QUIET=1`

Equivalent to `MISE_LOG_LEVEL=warn`.
Expand Down
1 change: 1 addition & 0 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ pub static ARGV0: Lazy<String> = Lazy::new(|| ARGS.read().unwrap()[0].to_string(
pub static MISE_BIN_NAME: Lazy<&str> = Lazy::new(|| filename(&ARGV0));
pub static MISE_LOG_FILE: Lazy<Option<PathBuf>> = Lazy::new(|| var_path("MISE_LOG_FILE"));
pub static MISE_LOG_FILE_LEVEL: Lazy<Option<LevelFilter>> = Lazy::new(log_file_level);
pub static MISE_LOG_HTTP: Lazy<bool> = Lazy::new(|| var_is_true("MISE_LOG_HTTP"));

pub static __USAGE: Lazy<Option<String>> = Lazy::new(|| var("__USAGE").ok());

Expand Down
6 changes: 6 additions & 0 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ impl Client {
let mut req = self.reqwest.get(url.clone());
req = req.headers(headers.clone());
let resp = req.send().await?;
if *env::MISE_LOG_HTTP {
eprintln!("GET {url} {}", resp.status());
}
debug!("GET {url} {}", resp.status());
display_github_rate_limit(&resp);
resp.error_for_status_ref()?;
Expand Down Expand Up @@ -113,6 +116,9 @@ impl Client {
let mut req = self.reqwest.head(url.clone());
req = req.headers(headers.clone());
let resp = req.send().await?;
if *env::MISE_LOG_HTTP {
eprintln!("HEAD {url} {}", resp.status());
}
debug!("HEAD {url} {}", resp.status());
display_github_rate_limit(&resp);
resp.error_for_status_ref()?;
Expand Down