Skip to content

Commit

Permalink
Merge pull request MaterializeInc#21492 from necaris/mz/print-warning…
Browse files Browse the repository at this point in the history
…-comment-stderr

mz: print some diagnostics to stderr rather than stdout
  • Loading branch information
Rami Chowdhury authored Aug 31, 2023
2 parents 9c9f60e + 2f0a3fe commit 4dc6582
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/mz/src/command/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ pub async fn run(
let region_info = cx.get_region_info().await?;
let email = claims.await?.email;

println!(
eprintln!(
"Authenticated using profile '{}'.",
cx.config_file().profile()
);
if let Some(cluster) = cluster.clone() {
println!("Connected to cluster '{}'.", cluster);
eprintln!("Connected to cluster '{}'.", cluster);
} else {
println!("Connected to the default cluster.")
eprintln!("Connected to the default cluster.")
}

let _error = sql_client
Expand Down
10 changes: 5 additions & 5 deletions src/mz/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ impl Context {
// Prints a warning comment about the cloud endpoint
/// TODO: Remove after releasing version 0.1.6 and give anyone using `mz` time to apply the fix.
pub fn print_warning_comment(&self) {
println!("⚠️ \t Warning\t ⚠️ \nStarting from version 0.1.3, it is a must to include the 'api.' subdomain in the cloud endpoint.");
println!("\nWrong: cloud-endpoint = \"https://staging.cloud.materialize.com\"");
println!("Right: cloud-endpoint = \"https://api.staging.cloud.materialize.com\"");
println!("\nPlease address this in your config before upcoming releases.");
println!("Config path: ~/.config/materialize/mz.toml.\n");
eprintln!("⚠️ \t Warning\t ⚠️ \nStarting from version 0.1.3, it is a must to include the 'api.' subdomain in the cloud endpoint.");
eprintln!("\nWrong: cloud-endpoint = \"https://staging.cloud.materialize.com\"");
eprintln!("Right: cloud-endpoint = \"https://api.staging.cloud.materialize.com\"");
eprintln!("\nPlease address this in your config before upcoming releases.");
eprintln!("Config path: ~/.config/materialize/mz.toml.\n");
}

/// Verifies the cloud endpoint is ok.
Expand Down

0 comments on commit 4dc6582

Please sign in to comment.