Skip to content

Commit

Permalink
print to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Aug 9, 2024
1 parent 48c9408 commit 0bd7b89
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/soroban-cli/src/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ impl Print {

pub fn print<T: Display + Sized>(&self, message: T) {
if !self.quiet {
print!("{message}");
eprint!("{message}");
}
}

pub fn println<T: Display + Sized>(&self, message: T) {
if !self.quiet {
println!("{message}");
eprintln!("{message}");
}
}

pub fn clear_line(&self) {
if cfg!(windows) {
print!("\r");
eprint!("\r");
} else {
print!("\r\x1b[2K");
eprint!("\r\x1b[2K");
}
}

Expand Down Expand Up @@ -66,14 +66,14 @@ macro_rules! create_print_functions {
#[allow(dead_code)]
pub fn $name<T: Display + Sized>(&self, message: T) {
if !self.quiet {
print!("{} {}", $icon, message);
eprint!("{} {}", $icon, message);
}
}

#[allow(dead_code)]
pub fn $nameln<T: Display + Sized>(&self, message: T) {
if !self.quiet {
println!("{} {}", $icon, message);
eprintln!("{} {}", $icon, message);
}
}
}
Expand Down

0 comments on commit 0bd7b89

Please sign in to comment.