Skip to content

Commit 6ad9ed5

Browse files
committed
refactor(log): replace [Ww]arning: log line prefix with warn:
1 parent b9011bf commit 6ad9ed5

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

rustup-init.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ ensure_loongarch_uapi() {
287287
exit 1
288288
;;
289289
*)
290-
echo "Warning: Cannot determine current system's ABI flavor, continuing anyway." >&2
290+
echo "warn: Cannot determine current system's ABI flavor, continuing anyway." >&2
291291
echo >&2
292292
echo 'Note that the official Rust distribution only works with the upstream' >&2
293293
echo 'kernel ABI. Installation will fail if your running kernel happens to be' >&2
@@ -601,9 +601,9 @@ downloader() {
601601
_err=$(curl $_retry --proto '=https' --tlsv1.2 --ciphers "$_ciphersuites" --silent --show-error --fail --location "$1" --output "$2" 2>&1)
602602
_status=$?
603603
else
604-
echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
604+
echo "warn: Not enforcing strong cipher suites for TLS, this is potentially less secure"
605605
if ! check_help_for "$3" curl --proto --tlsv1.2; then
606-
echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
606+
echo "warn: Not enforcing TLS v1.2, this is potentially less secure"
607607
_err=$(curl $_retry --silent --show-error --fail --location "$1" --output "$2" 2>&1)
608608
_status=$?
609609
else
@@ -620,7 +620,7 @@ downloader() {
620620
return $_status
621621
elif [ "$_dld" = wget ]; then
622622
if [ "$(wget -V 2>&1|head -2|tail -1|cut -f1 -d" ")" = "BusyBox" ]; then
623-
echo "Warning: using the BusyBox version of wget. Not enforcing strong cipher suites for TLS or TLS v1.2, this is potentially less secure"
623+
echo "warn: using the BusyBox version of wget. Not enforcing strong cipher suites for TLS or TLS v1.2, this is potentially less secure"
624624
_err=$(wget "$1" -O "$2" 2>&1)
625625
_status=$?
626626
else
@@ -630,9 +630,9 @@ downloader() {
630630
_err=$(wget --https-only --secure-protocol=TLSv1_2 --ciphers "$_ciphersuites" "$1" -O "$2" 2>&1)
631631
_status=$?
632632
else
633-
echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
633+
echo "warn: Not enforcing strong cipher suites for TLS, this is potentially less secure"
634634
if ! check_help_for "$3" wget --https-only --secure-protocol; then
635-
echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
635+
echo "warn: Not enforcing TLS v1.2, this is potentially less secure"
636636
_err=$(wget "$1" -O "$2" 2>&1)
637637
_status=$?
638638
else
@@ -679,7 +679,7 @@ check_help_for() {
679679
# fail to find these options to force fallback
680680
if [ "$(sw_vers -productVersion | cut -d. -f2)" -lt 13 ]; then
681681
# Older than 10.13
682-
echo "Warning: Detected macOS platform older than 10.13"
682+
echo "warn: Detected macOS platform older than 10.13"
683683
return 1
684684
fi
685685
;;
@@ -688,7 +688,7 @@ check_help_for() {
688688
;;
689689
*)
690690
# Unknown product version, warn and continue
691-
echo "Warning: Detected unknown macOS major version: $(sw_vers -productVersion)"
691+
echo "warn: Detected unknown macOS major version: $(sw_vers -productVersion)"
692692
echo "Warning TLS capabilities detection may fail"
693693
;;
694694
esac

src/cli/self_update/windows.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ mod tests {
852852
);
853853
});
854854
assert_eq!(
855-
r"warning: the registry key HKEY_CURRENT_USER\Environment\PATH is not a string. Not modifying the PATH variable
855+
r"warn: the registry key HKEY_CURRENT_USER\Environment\PATH is not a string. Not modifying the PATH variable
856856
",
857857
String::from_utf8(tp.stderr()).unwrap()
858858
);

src/utils/notify.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl fmt::Display for NotificationLevel {
1717
NotificationLevel::Trace => "trace",
1818
NotificationLevel::Debug => "debug",
1919
NotificationLevel::Info => "info",
20-
NotificationLevel::Warn => "warning",
20+
NotificationLevel::Warn => "warn",
2121
NotificationLevel::Error => "error",
2222
})
2323
}

tests/suite/cli_inst_interactive.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ fn install_forces_and_skips_rls() {
432432
assert!(out.ok);
433433
assert!(out
434434
.stderr
435-
.contains("warning: Force-skipping unavailable component"));
435+
.contains("warn: Force-skipping unavailable component"));
436436
});
437437
}
438438

@@ -447,7 +447,7 @@ fn test_warn_if_complete_profile_is_used() {
447447
"complete",
448448
"--no-modify-path",
449449
],
450-
"warning: downloading with complete profile",
450+
"warn: downloading with complete profile",
451451
);
452452
});
453453
}
@@ -460,7 +460,7 @@ fn test_prompt_fail_if_rustup_sh_already_installed_reply_nothing() {
460460
assert!(!out.ok);
461461
assert!(out
462462
.stderr
463-
.contains("warning: it looks like you have existing rustup.sh metadata"));
463+
.contains("warn: it looks like you have existing rustup.sh metadata"));
464464
assert!(out
465465
.stderr
466466
.contains("error: cannot install while rustup.sh is installed"));
@@ -476,7 +476,7 @@ fn test_prompt_fail_if_rustup_sh_already_installed_reply_no() {
476476
assert!(!out.ok);
477477
assert!(out
478478
.stderr
479-
.contains("warning: it looks like you have existing rustup.sh metadata"));
479+
.contains("warn: it looks like you have existing rustup.sh metadata"));
480480
assert!(out
481481
.stderr
482482
.contains("error: cannot install while rustup.sh is installed"));
@@ -491,14 +491,14 @@ fn test_prompt_succeed_if_rustup_sh_already_installed_reply_yes() {
491491
let out = run_input(config, &["rustup-init", "--no-modify-path"], "yes\n\n\n");
492492
assert!(out
493493
.stderr
494-
.contains("warning: it looks like you have existing rustup.sh metadata"));
494+
.contains("warn: it looks like you have existing rustup.sh metadata"));
495495
assert!(out
496496
.stderr
497497
.contains("error: cannot install while rustup.sh is installed"));
498498
assert!(out.stdout.contains("Continue? (y/N)"));
499-
assert!(!out.stdout.contains(
500-
"warning: continuing (because the -y flag is set and the error is ignorable)"
501-
));
499+
assert!(!out
500+
.stdout
501+
.contains("warn: continuing (because the -y flag is set and the error is ignorable)"));
502502
assert!(out.ok);
503503
})
504504
}

tests/suite/cli_rustup.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ components = [ "rust-bongo" ]
20652065

20662066
config.expect_stderr_ok(
20672067
&["rustc", "--version"],
2068-
"warning: Force-skipping unavailable component 'rust-bongo",
2068+
"warn: Force-skipping unavailable component 'rust-bongo",
20692069
);
20702070
})
20712071
});
@@ -2533,8 +2533,8 @@ fn warn_on_unmatch_build() {
25332533
config.expect_stderr_ok(
25342534
&["rustup", "toolchain", "install", &format!("nightly-{arch}")],
25352535
&format!(
2536-
r"warning: toolchain 'nightly-{arch}' may not be able to run on this system.
2537-
warning: If you meant to build software to target that platform, perhaps try `rustup target add {arch}` instead?",
2536+
r"warn: toolchain 'nightly-{arch}' may not be able to run on this system.
2537+
warn: If you meant to build software to target that platform, perhaps try `rustup target add {arch}` instead?",
25382538
),
25392539
);
25402540
})
@@ -2560,7 +2560,7 @@ fn dont_warn_on_partial_build() {
25602560
r"info: syncing channel updates for 'nightly-{triple}'"
25612561
)));
25622562
assert!(!stderr.contains(&format!(
2563-
r"warning: toolchain 'nightly-{arch}' may not be able to run on this system."
2563+
r"warn: toolchain 'nightly-{arch}' may not be able to run on this system."
25642564
)));
25652565
})
25662566
})
@@ -2613,7 +2613,7 @@ fn warn_on_duplicate_rust_toolchain_file() {
26132613
config.expect_stderr_ok(
26142614
&["rustc", "--version"],
26152615
&format!(
2616-
"warning: both `{0}` and `{1}` exist. Using `{0}`",
2616+
"warn: both `{0}` and `{1}` exist. Using `{0}`",
26172617
toolchain_file_1.canonicalize().unwrap().display(),
26182618
toolchain_file_2.canonicalize().unwrap().display(),
26192619
),

tests/suite/cli_self_upd.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -744,13 +744,13 @@ fn test_warn_succeed_if_rustup_sh_already_installed_y_flag() {
744744
assert!(out.ok);
745745
assert!(out
746746
.stderr
747-
.contains("warning: it looks like you have existing rustup.sh metadata"));
747+
.contains("warn: it looks like you have existing rustup.sh metadata"));
748748
assert!(out
749749
.stderr
750750
.contains("error: cannot install while rustup.sh is installed"));
751-
assert!(out.stderr.contains(
752-
"warning: continuing (because the -y flag is set and the error is ignorable)"
753-
));
751+
assert!(out
752+
.stderr
753+
.contains("warn: continuing (because the -y flag is set and the error is ignorable)"));
754754
assert!(!out.stdout.contains("Continue? (y/N)"));
755755
})
756756
}
@@ -767,13 +767,13 @@ fn test_succeed_if_rustup_sh_already_installed_env_var_set() {
767767
assert!(out.ok);
768768
assert!(!out
769769
.stderr
770-
.contains("warning: it looks like you have existing rustup.sh metadata"));
770+
.contains("warn: it looks like you have existing rustup.sh metadata"));
771771
assert!(!out
772772
.stderr
773773
.contains("error: cannot install while rustup.sh is installed"));
774-
assert!(!out.stderr.contains(
775-
"warning: continuing (because the -y flag is set and the error is ignorable)"
776-
));
774+
assert!(!out
775+
.stderr
776+
.contains("warn: continuing (because the -y flag is set and the error is ignorable)"));
777777
assert!(!out.stdout.contains("Continue? (y/N)"));
778778
})
779779
}

tests/suite/cli_v2.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ fn test_warn_if_complete_profile_is_used() {
13531353
"complete",
13541354
"stable",
13551355
],
1356-
"warning: downloading with complete profile",
1356+
"warn: downloading with complete profile",
13571357
);
13581358
});
13591359
}
@@ -1377,7 +1377,7 @@ fn test_complete_profile_skips_missing_when_forced() {
13771377
// Now try and force
13781378
config.expect_stderr_ok(
13791379
&["rustup", "toolchain", "install", "--force", "nightly"],
1380-
for_host!("warning: Force-skipping unavailable component 'rls-{}'"),
1380+
for_host!("warn: Force-skipping unavailable component 'rls-{}'"),
13811381
);
13821382

13831383
// Ensure that the skipped component (rls) is not installed
@@ -1407,7 +1407,7 @@ fn run_with_install_flag_against_unavailable_component() {
14071407
for_host!(
14081408
r"info: syncing channel updates for 'nightly-{0}'
14091409
info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
1410-
warning: Force-skipping unavailable component 'rust-std-{0}'
1410+
warn: Force-skipping unavailable component 'rust-std-{0}'
14111411
info: downloading component 'cargo'
14121412
info: downloading component 'rust-docs'
14131413
info: downloading component 'rustc'

0 commit comments

Comments
 (0)