Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logs for uniformity (#716) #723

Merged
merged 3 commits into from
Dec 22, 2020
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
8 changes: 4 additions & 4 deletions src/progressbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ impl ProgressOutput {
pub fn warn(&self, message: &str) {
if !self.quiet() && self.is_log_enabled(LogLevel::Warn) {
let warn = format!(
"{} {}: {}",
emoji::WARN,
"{}: {} {}",
style("[WARN]").bold().dim(),
emoji::WARN,
message
);
self.message(&warn);
Expand All @@ -95,9 +95,9 @@ impl ProgressOutput {
pub fn error(&self, message: &str) {
if self.is_log_enabled(LogLevel::Error) {
let err = format!(
"{} {}: {}",
emoji::ERROR,
"{}: {} {}",
style("[ERR]").bold().dim(),
emoji::ERROR,
message
);
self.message(&err);
Expand Down
2 changes: 1 addition & 1 deletion tests/all/log_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn matches_info() -> impl Predicate<str> + PredicateReflection {
}

fn matches_warn() -> impl Predicate<str> + PredicateReflection {
contains(":-) [WARN]: origin crate has no README")
contains("[WARN]: :-) origin crate has no README")
}

fn matches_cargo() -> impl Predicate<str> + PredicateReflection {
Expand Down
6 changes: 3 additions & 3 deletions tests/all/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ fn parse_crate_data_returns_unused_keys_in_cargo_toml() {
.assert()
.success()
.stderr(predicates::str::contains(
"[WARN]: \"package.metadata.wasm-pack.profile.production\" is an unknown key and will \
be ignored. Please check your Cargo.toml.",
));
"[WARN]: :-) \"package.metadata.wasm-pack.profile.production\" is an unknown key and will \
be ignored. Please check your Cargo.toml.",
));
}

#[test]
Expand Down