Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Dec 10, 2024
1 parent de40613 commit 627a081
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/bin/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ pub fn init_logger(debug: bool, verbose: bool, krate: &str) {
match (debug, verbose) {
(true, _) => {
builder.filter(Some(krate), LevelFilter::Debug);
builder.filter(Some("cargo_deadlinks"), LevelFilter::Debug);
}
(false, true) => {
builder.filter(Some(krate), LevelFilter::Info);
builder.filter(Some("cargo_deadlinks"), LevelFilter::Info);
}
_ => {}
}
Expand Down
5 changes: 3 additions & 2 deletions src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::fmt;
use std::fs::read_to_string;
use std::path::{Path, PathBuf};

use log::{debug, warn};
use log::{debug, info, warn};
use once_cell::sync::Lazy;
use regex::Regex;
use url::Url;
Expand Down Expand Up @@ -314,6 +314,7 @@ fn check_http_url(url: &Url, ctx: &CheckContext) -> Result<(), CheckError> {
// The URL might contain a fragment. In that case we need a full GET
// request to check if the fragment exists.
if url.fragment().is_none() || !ctx.check_fragments {
info!("Check URL {url}");

Check failure on line 317 in src/check.rs

View workflow job for this annotation

GitHub Actions / Check MSRV

there is no argument named `url`
match ureq::head(url.as_str()).call() {
Err(ureq::Error::Status(405, _)) => {
// If HEAD isn't allowed, try sending a GET instead
Expand All @@ -331,7 +332,7 @@ fn check_http_url(url: &Url, ctx: &CheckContext) -> Result<(), CheckError> {
}

fn check_http_fragment(url: &Url, fragment: &str) -> Result<(), CheckError> {
debug!("Checking fragment {} of URL {}.", fragment, url.as_str());
info!("Checking fragment {} of URL {}.", fragment, url.as_str());

fn get_html(url: &Url) -> Result<String, CheckError> {
let resp = ureq::get(url.as_str()).call()?;
Expand Down

0 comments on commit 627a081

Please sign in to comment.