Skip to content

Commit

Permalink
Merge pull request #723 from petosorus/master
Browse files Browse the repository at this point in the history
Fix logs for uniformity (#716)
  • Loading branch information
ashleygwilliams authored Dec 22, 2020
2 parents 21d8302 + c2d5d5a commit d46d1c6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit d46d1c6

Please sign in to comment.