Skip to content

Commit

Permalink
Promote 'skip checking' message to a warning
Browse files Browse the repository at this point in the history
Example output:

```
$ RUST_LOG=warn cargo deadlinks
[2021-01-08T15:21:18Z WARN  cargo_deadlinks::check] Skip checking http://example.com/ as checking of http URLs is turned off
[2021-01-08T15:21:18Z WARN  cargo_deadlinks::check] Skip checking https://play.rust-lang.org/ as checking of http URLs is turned off
[2021-01-08T15:21:18Z WARN  cargo_deadlinks::check] Skip checking
https://tinyurl.com/rnxcavf as checking of http URLs is turned off
```
  • Loading branch information
jyn514 authored and Joshua Nelson committed Jan 9, 2021
1 parent 5ed5765 commit aba1fac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

[PR#136]: https://github.com/deadlinks/cargo-deadlinks/pull/136

#### Changed

* Give a warning when HTTP links are present but `--check-http` wasn't passed. Previously this was only a DEBUG message.
Note that this still requires opting-in to warnings with `RUST_LOG=warn`. [PR#137]

[PR#137]: https://github.com/deadlinks/cargo-deadlinks/pull/137

<a name="0.7.1"></a>
## 0.7.1 (2020-12-18)

Expand Down
4 changes: 2 additions & 2 deletions src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fn handle_response(url: &Url, resp: ureq::Response) -> Result<ureq::Response, Ch
/// Check a URL with "http" or "https" scheme for availability. Returns `false` if it is unavailable.
fn check_http_url(url: &Url, ctx: &CheckContext) -> Result<(), CheckError> {
if !ctx.check_http {
debug!(
warn!(
"Skip checking {} as checking of http URLs is turned off",
url
);
Expand All @@ -282,7 +282,7 @@ fn check_http_url(url: &Url, ctx: &CheckContext) -> Result<(), CheckError> {

for blacklisted_prefix in PREFIX_BLACKLIST.iter() {
if url.as_str().starts_with(blacklisted_prefix) {
debug!(
warn!(
"Skip checking {} as URL prefix is on the builtin blacklist",
url
);
Expand Down

0 comments on commit aba1fac

Please sign in to comment.