Change verbosity from debug -> info in forc init
@@ -5,7 +5,7 @@ use forc_util::validate_name;
use std::fs;
use std::path::{Path, PathBuf};
use sway_utils::constants;
-use tracing::{debug, info};
+use tracing::info;
fn print_welcome_message() {
let read_the_docs = format!(
@@ -53,10 +53,12 @@ pub fn init(command: InitCommand) -> Result<()> {
);
}
- debug!(
+ if command.verbose {
+ info!(
"\nUsing project directory at {}",
project_dir.canonicalize()?.display()
);
+ }
let project_name = match command.name {
Some(name) => name,
@@ -140,21 +142,27 @@ pub fn init(command: InitCommand) -> Result<()> {
let harness_path = Path::new(&project_dir).join("tests").join("harness.rs");
fs::write(&harness_path, defaults::default_test_program(&project_name))?;
- debug!(
+ if command.verbose {
+ info!(
"\nCreated test harness at {}",
harness_path.canonicalize()?.display()
);
+ }
// Ignore default `out` and `target` directories created by forc and cargo.
let gitignore_path = Path::new(&project_dir).join(".gitignore");
fs::write(&gitignore_path, defaults::default_gitignore())?;
- debug!(
+ if command.verbose {
+ info!(
"\nCreated .gitignore at {}",
gitignore_path.canonicalize()?.display()
);
+ }
- debug!("\nSuccessfully created {program_type}: {project_name}",);
+ if command.verbose {
+ info!("\nSuccessfully created {program_type}: {project_name}",);
+ }
print_welcome_message();
