Skip to content

Commit e28403e

Browse files
committed
switched to log::debug! from println! for plug subcommand; skipped using the progress bar output when only one thing to do
1 parent dc3081f commit e28403e

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

crates/wac-resolver/src/registry.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ impl RegistryPackageResolver {
8686

8787
// fetch required package logs and return error if any not found
8888
if let Some(bar) = self.bar.as_ref() {
89-
bar.init(1);
9089
bar.println("Updating", "package logs from the registry");
9190
}
9291

@@ -108,9 +107,6 @@ impl RegistryPackageResolver {
108107
}
109108

110109
if let Some(bar) = self.bar.as_ref() {
111-
bar.inc(1);
112-
bar.finish();
113-
114110
// download package content if not in cache
115111
bar.init(keys.len());
116112
bar.println("Downloading", "package content from the registry");

src/commands/plug.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl PlugCommand {
112112

113113
if let Some(ver) = version {
114114
let download = client.download_exact(name, ver).await?;
115-
println!(
115+
log::debug!(
116116
"Plugging `{name}` version `{ver}` using registry `{registry}`",
117117
registry = client.url()
118118
);
@@ -123,7 +123,7 @@ impl PlugCommand {
123123
.await?
124124
.ok_or_else(|| anyhow::anyhow!("package `{name}` was not found"))?;
125125

126-
println!(
126+
log::debug!(
127127
"Plugging `{name}` version `{ver}` using registry `{registry}`",
128128
ver = &download.version,
129129
registry = client.url()
@@ -132,7 +132,7 @@ impl PlugCommand {
132132
}
133133
}
134134
PackageRef::LocalPath(path) => {
135-
println!("Plugging `{path}`", path = path.display());
135+
log::debug!("Plugging `{path}`", path = path.display());
136136

137137
path.clone()
138138
}
@@ -178,7 +178,7 @@ impl PlugCommand {
178178

179179
let path = if let Some(ver) = version {
180180
let download = client.download_exact(name, ver).await?;
181-
println!(
181+
log::debug!(
182182
" with `{name}` version `{ver}` using registry `{registry}`",
183183
registry = client.url()
184184
);
@@ -189,7 +189,7 @@ impl PlugCommand {
189189
.await?
190190
.ok_or_else(|| anyhow::anyhow!("package `{name}` was not found"))?;
191191

192-
println!(
192+
log::debug!(
193193
" with `{name}` version `{ver}` using registry `{registry}`",
194194
ver = &download.version,
195195
registry = client.url()
@@ -201,7 +201,7 @@ impl PlugCommand {
201201
(name, path)
202202
}
203203
PackageRef::LocalPath(path) => {
204-
println!(" with `{path}`", path = path.display());
204+
log::debug!(" with `{path}`", path = path.display());
205205
(format!("plug:{name}"), path.clone())
206206
}
207207
};
@@ -252,7 +252,7 @@ impl PlugCommand {
252252
"failed to write output file `{path}`",
253253
path = path.display()
254254
))?;
255-
println!("\nWrote plugged component: `{path}`", path = path.display());
255+
log::debug!("\nWrote plugged component: `{path}`", path = path.display());
256256
}
257257
None => {
258258
std::io::stdout()

0 commit comments

Comments
 (0)