diff options
Diffstat (limited to 'cli/tools')
-rw-r--r-- | cli/tools/bundle.rs | 2 | ||||
-rw-r--r-- | cli/tools/fmt.rs | 5 | ||||
-rw-r--r-- | cli/tools/installer.rs | 22 | ||||
-rw-r--r-- | cli/tools/standalone.rs | 6 | ||||
-rw-r--r-- | cli/tools/vendor/mod.rs | 6 |
5 files changed, 20 insertions, 21 deletions
diff --git a/cli/tools/bundle.rs b/cli/tools/bundle.rs index 606bab46f..95aa52b5b 100644 --- a/cli/tools/bundle.rs +++ b/cli/tools/bundle.rs @@ -143,7 +143,7 @@ fn bundle_module_graph( .resolve_ts_config_for_emit(TsConfigType::Bundle)?; if ps.options.type_check_mode() == TypeCheckMode::None { if let Some(ignored_options) = ts_config_result.maybe_ignored_options { - eprintln!("{}", ignored_options); + log::warn!("{}", ignored_options); } } diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 7b5797d88..fee59c6dc 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -28,6 +28,7 @@ use deno_core::futures; use deno_core::parking_lot::Mutex; use log::debug; use log::info; +use log::warn; use std::fs; use std::io::stdin; use std::io::stdout; @@ -325,8 +326,8 @@ async fn check_source_files( Err(e) => { not_formatted_files_count.fetch_add(1, Ordering::Relaxed); let _g = output_lock.lock(); - eprintln!("Error checking: {}", file_path.to_string_lossy()); - eprintln!(" {}", e); + warn!("Error checking: {}", file_path.to_string_lossy()); + warn!(" {}", e); } } Ok(()) diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index fd7f68b71..cef4befc8 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -186,7 +186,7 @@ pub fn uninstall(name: String, root: Option<PathBuf>) -> Result<(), AnyError> { if file_path.exists() { fs::remove_file(&file_path)?; - println!("deleted {}", file_path.to_string_lossy()); + log::info!("deleted {}", file_path.to_string_lossy()); removed = true }; @@ -194,7 +194,7 @@ pub fn uninstall(name: String, root: Option<PathBuf>) -> Result<(), AnyError> { let file_path = file_path.with_extension("cmd"); if file_path.exists() { fs::remove_file(&file_path)?; - println!("deleted {}", file_path.to_string_lossy()); + log::info!("deleted {}", file_path.to_string_lossy()); removed = true } } @@ -208,11 +208,11 @@ pub fn uninstall(name: String, root: Option<PathBuf>) -> Result<(), AnyError> { let file_path = file_path.with_extension(ext); if file_path.exists() { fs::remove_file(&file_path)?; - println!("deleted {}", file_path.to_string_lossy()); + log::info!("deleted {}", file_path.to_string_lossy()); } } - println!("✅ Successfully uninstalled {}", name); + log::info!("✅ Successfully uninstalled {}", name); Ok(()) } @@ -256,20 +256,20 @@ fn create_install_shim( fs::write(path, contents)?; } - println!("✅ Successfully installed {}", shim_data.name); - println!("{}", shim_data.file_path.display()); + log::info!("✅ Successfully installed {}", shim_data.name); + log::info!("{}", shim_data.file_path.display()); if cfg!(windows) { let display_path = shim_data.file_path.with_extension(""); - println!("{} (shell)", display_path.display()); + log::info!("{} (shell)", display_path.display()); } let installation_dir_str = shim_data.installation_dir.to_string_lossy(); if !is_in_path(&shim_data.installation_dir) { - println!("ℹ️ Add {} to PATH", installation_dir_str); + log::info!("ℹ️ Add {} to PATH", installation_dir_str); if cfg!(windows) { - println!(" set PATH=%PATH%;{}", installation_dir_str); + log::info!(" set PATH=%PATH%;{}", installation_dir_str); } else { - println!(" export PATH=\"{}:$PATH\"", installation_dir_str); + log::info!(" export PATH=\"{}:$PATH\"", installation_dir_str); } } @@ -605,7 +605,6 @@ mod tests { assert!(file_path.exists()); let content = fs::read_to_string(file_path).unwrap(); - println!("this is the file path {:?}", content); if cfg!(windows) { assert!(content.contains( r#""run" "--unstable" "http://localhost:4545/echo_server.ts""# @@ -970,7 +969,6 @@ mod tests { assert!(file_path.exists()); let content = fs::read_to_string(file_path).unwrap(); - println!("{}", content); if cfg!(windows) { // TODO: see comment above this test } else { diff --git a/cli/tools/standalone.rs b/cli/tools/standalone.rs index f7a258a73..c276119ea 100644 --- a/cli/tools/standalone.rs +++ b/cli/tools/standalone.rs @@ -122,15 +122,15 @@ async fn download_base_binary( let client_builder = Client::builder(); let client = client_builder.build()?; - println!("Checking {}", &download_url); + log::info!("Checking {}", &download_url); let res = client.get(&download_url).send().await?; let binary_content = if res.status().is_success() { - println!("Download has been found"); + log::info!("Download has been found"); res.bytes().await?.to_vec() } else { - println!("Download could not be found, aborting"); + log::info!("Download could not be found, aborting"); std::process::exit(1) }; diff --git a/cli/tools/vendor/mod.rs b/cli/tools/vendor/mod.rs index ed0c69501..02261e34c 100644 --- a/cli/tools/vendor/mod.rs +++ b/cli/tools/vendor/mod.rs @@ -53,7 +53,7 @@ pub async fn vendor( &build::RealVendorEnvironment, )?; - eprintln!( + log::info!( concat!("Vendored {} {} into {} directory.",), vendored_count, if vendored_count == 1 { @@ -66,7 +66,7 @@ pub async fn vendor( if vendored_count > 0 { let import_map_path = raw_output_dir.join("import_map.json"); if maybe_update_config_file(&output_dir, &ps) { - eprintln!( + log::info!( concat!( "\nUpdated your local Deno configuration file with a reference to the ", "new vendored import map at {}. Invoking Deno subcommands will now ", @@ -77,7 +77,7 @@ pub async fn vendor( import_map_path.display(), ); } else { - eprintln!( + log::info!( concat!( "\nTo use vendored modules, specify the `--import-map {}` flag when ", r#"invoking Deno subcommands or add an `"importMap": "<path_to_vendored_import_map>"` "#, |