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

Print local testnet logs as println and errors as eprintln #15005

Merged
merged 2 commits into from
Oct 18, 2024
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
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))?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming, you're happy for this to be spread across multiple lines? If not, you can just use {} instead of {:#}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it is one line?

Unexpected error: Failed to apply pre run steps for Postgres: Docker is not available, confirm it is installed and running. See https://aptos.dev/guides/local-development-network#faq for assistance. (version_home): error trying to connect: No such file or directory (os error 2): No such file or directory (os error 2)
image


// 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
Loading