Skip to content

Commit 9c71851

Browse files
committed
notifications: log directly when installing components
1 parent 37bcf4d commit 9c71851

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

src/dist/manifestation.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,14 @@ impl Manifestation {
242242
let short_pkg_name = component.short_name_in_manifest();
243243
let short_name = component.short_name(new_manifest);
244244

245-
(download_cfg.notify_handler)(Notification::InstallingComponent(
246-
&short_name,
247-
&self.target_triple,
248-
component.target.as_ref(),
249-
));
245+
match &component.target {
246+
Some(t) if t != &self.target_triple => {
247+
info!(component = short_name, "installing component");
248+
}
249+
_ => {
250+
info!(component = short_name, target = %self.target_triple, "installing component")
251+
}
252+
}
250253

251254
let cx = PackageContext {
252255
tmp_cx,
@@ -450,12 +453,7 @@ impl Manifestation {
450453
let (installer_file, installer_hash) = dl.unwrap();
451454

452455
let prefix = self.installation.prefix();
453-
454-
notify_handler(Notification::InstallingComponent(
455-
"rust",
456-
&self.target_triple,
457-
Some(&self.target_triple),
458-
));
456+
info!(component = "rust", "installing component");
459457

460458
// Begin transaction
461459
let mut tx = Transaction::new(prefix, tmp_cx, process);

src/notifications.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub(crate) enum Notification<'a> {
1515
CachedFileChecksumFailed,
1616
/// The URL of the download is passed as the last argument, to allow us to track concurrent downloads.
1717
DownloadingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>, &'a str),
18-
InstallingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>),
1918
RemovingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>),
2019
RemovingOldComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>),
2120
DownloadingManifest(&'a str),
@@ -71,7 +70,6 @@ impl Notification<'_> {
7170
match self {
7271
FileAlreadyDownloaded | DownloadingLegacyManifest => NotificationLevel::Debug,
7372
DownloadingComponent(_, _, _, _)
74-
| InstallingComponent(_, _, _)
7573
| RemovingComponent(_, _, _)
7674
| RemovingOldComponent(_, _, _)
7775
| DownloadingManifest(_)
@@ -123,13 +121,6 @@ impl Display for Notification<'_> {
123121
write!(f, "downloading component '{}' for '{}'", c, t.unwrap())
124122
}
125123
}
126-
InstallingComponent(c, h, t) => {
127-
if Some(h) == t.as_ref() || t.is_none() {
128-
write!(f, "installing component '{c}'")
129-
} else {
130-
write!(f, "installing component '{}' for '{}'", c, t.unwrap())
131-
}
132-
}
133124
RemovingComponent(c, h, t) => {
134125
if Some(h) == t.as_ref() || t.is_none() {
135126
write!(f, "removing component '{c}'")

0 commit comments

Comments
 (0)