Skip to content

Commit

Permalink
print local testnet log as println and errors as eprintln (#15005)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmaayan authored Oct 18, 2024
1 parent 51894d4 commit 20ba96d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions crates/aptos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to the Aptos CLI will be captured in this file. This project
- `aptos move fmt` formats move files inside the `tests` and `examples` directory of a package.
- Add `aptos update prover-dependencies`, which installs the dependency of Move prover, boogie, z3 and cvc5.
- Update the default version of `movefmt` to be installed from 1.0.4 to 1.0.5
- Update the local-testnet logs to use `println` for regular output and reserve `eprintln` for errors.

## [4.2.3] - 2024/09/20
- Fix the broken indexer in localnet in 4.2.2, which migrates table info from sycn to async ways.
Expand Down
3 changes: 2 additions & 1 deletion crates/aptos/src/node/local_testnet/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ pub const CONTAINER_NETWORK_NAME: &str = "aptos-local-testnet-network";
/// there no second location, there is just the one named pipe.
pub async fn get_docker() -> Result<Docker> {
let docker = Docker::connect_with_local_defaults()
.context(format!("{} (init_default)", ERROR_MESSAGE))?;
.context(format!("{} (init_default)", ERROR_MESSAGE))
.inspect_err(|e| eprintln!("{:#}", e))?;

// We have to specify the type because the compiler can't figure out the error
// in the case where the system is Unix.
Expand Down
6 changes: 3 additions & 3 deletions crates/aptos/src/node/local_testnet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ impl RunLocalnet {
HealthChecker::IndexerApiMetadata(_) => continue,
};
if !silent {
eprintln!("{} is starting, please wait...", health_checker);
println!("{} is starting, please wait...", health_checker);
} else {
info!("[silent] {} is starting, please wait...", health_checker);
}
let fut = async move {
health_checker.wait(None).await?;
if !silent {
eprintln!(
println!(
"{} is ready. Endpoint: {}",
health_checker,
health_checker.address_str()
Expand Down Expand Up @@ -337,7 +337,7 @@ impl CliCommand<()> for RunLocalnet {
})?;
}

eprintln!(
println!(
"\nReadiness endpoint: http://{}:{}/\n",
bind_to, self.ready_server_args.ready_server_listen_port,
);
Expand Down

0 comments on commit 20ba96d

Please sign in to comment.