Skip to content

Commit

Permalink
tasks: correctly indent final status
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Sep 24, 2024
1 parent e3f0b77 commit 3061754
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 193 deletions.
130 changes: 22 additions & 108 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions devenv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ default-run = "devenv"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ansiterm.workspace = true
clap.workspace = true
cli-table.workspace = true
crossterm = "0.28.1"
console = "0.15.8"
dotlock.workspace = true
fs2.workspace = true
hex.workspace = true
Expand Down
16 changes: 8 additions & 8 deletions devenv/src/log.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ansiterm::Colour::{Blue, DarkGray, Green, Red, Yellow};
use console::style;
use std::io::Write;
use std::time::Instant;

Expand Down Expand Up @@ -33,7 +33,7 @@ pub struct LogProgress {

impl LogProgress {
pub fn new(message: &str, newline: bool) -> LogProgress {
let prefix = Blue.paint("•");
let prefix = style("•").blue();
eprint!("{} {} ...", prefix, message);
if newline {
eprintln!();
Expand All @@ -51,9 +51,9 @@ impl Drop for LogProgress {
fn drop(&mut self) {
let duration = self.start.unwrap_or_else(Instant::now).elapsed();
let prefix = if self.failed {
Red.paint("✖")
style("✖").red()
} else {
Green.paint("✔")
style("✔").green()
};
eprintln!(
"\r{} {} in {:.1}s.",
Expand Down Expand Up @@ -105,19 +105,19 @@ impl Logger {
}
match level {
Level::Info => {
let prefix = Blue.paint("•");
let prefix = style("•").blue();
eprintln!("{} {}", prefix, message);
}
Level::Error => {
let prefix = Red.paint("✖");
let prefix = style("✖").red();
eprintln!("{} {}", prefix, message);
}
Level::Warn => {
let prefix = Yellow.paint("•");
let prefix = style("•").yellow();
eprintln!("{} {}", prefix, message);
}
Level::Debug => {
let prefix = DarkGray.paint("•");
let prefix = style("•").italic();
eprintln!("{} {}", prefix, message);
}
Level::Silent => {}
Expand Down
Loading

0 comments on commit 3061754

Please sign in to comment.