Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions core/patina_internal_depex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,27 @@ impl Depex {
false
}

/// Report protocol present status in the DEPEX expression.
pub fn report_protocol_present(&self) {
for opcode in self.expression.iter() {
match opcode {
Opcode::Push(guid, present) => {
log::debug!(
target: "patina_depex_report",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this information is generally useful, I don’t think it needs to be hidden behind a target

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"patina_depex_report" target removed.

Using the same target and level of the summary section, which is log::warn!(target: "patina_dxe_core"

image

" {guid:?} : {present}"
);
Comment on lines +290 to +293

@makubacki makubacki Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this at warn level coupled with the patina_dxe_core target is a code smell in terms of coupling. Basically, this assumes code exists a certain way in the code (patina_dxe_core) that uses this crate (patina_internal_depex) as a dependency.

This type of print should be at least info or a more verbose type if left at the patina_dxe_core target level.

But I really think this code should really just return something like an iterator of protocols present for a given Depex so all logging stays in the caller.

@os-d os-d Jun 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I just meant don't use a target at all for the logging. It will inherit the patina_internal_depex target if a consumer wants to filter it.

But, to Michael's point, I think that returning an iterator here and letting the caller print it works well.

}
Opcode::End => {
log::debug!(
target: "patina_depex_report",
" {opcode:?}"
);
}
_ => {}
}
}
}

/// If the depex expression is an associated dependency, it returns the associated dependency.
pub fn is_associated(&self) -> Option<AssociatedDependency> {
match self.expression.first() {
Expand Down
24 changes: 24 additions & 0 deletions patina_dxe_core/src/pi_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,30 @@ impl<P: PlatformInfo> PiDispatcher<P> {
guid_fmt!(driver.file_name)
);
}

const EVAL_REPORT: &str = "patina_depex_report";

if log::log_enabled!(target: EVAL_REPORT, log::Level::Debug) {
log::debug!(target: EVAL_REPORT, "Begin Detail Report:");
for driver in self.dispatcher_context.lock().pending_drivers.iter() {
log::debug!(
target: EVAL_REPORT,
"Driver {} ({:?}) found but not dispatched. Protocols present:",
Comment thread
joschock marked this conversation as resolved.
Outdated
driver.name.as_deref().unwrap_or("Unnamed"),
guid_fmt!(driver.file_name)
);

match &driver.depex {
Some(depex) => {
depex.report_protocol_present();
}
_ => {
log::debug!(target: EVAL_REPORT, " No Depex");
}
}
}
log::debug!(target: EVAL_REPORT, "End Detail Report.");
}
}
Comment on lines +117 to 136

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The messages in this "detailed report" should be at info level or higher. I think debug level.

The normal case of a driver not dispatched is already covered by warn above. This is debug information.


/// Initializes the dispatcher by registering for FV protocol installation events.
Expand Down
Loading