-
Notifications
You must be signed in to change notification settings - Fork 50
patina_internal_depex: Report protocol present status #1552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d4a0688
bea1472
aa8fa25
f02fd80
bcc2168
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,13 +105,34 @@ impl<P: PlatformInfo> PiDispatcher<P> { | |
|
|
||
| /// Displays drivers that were discovered but not dispatched. | ||
| pub fn display_discovered_not_dispatched(&self) { | ||
| for driver in &self.dispatcher_context.lock().pending_drivers { | ||
| // Summary report | ||
| for driver in self.dispatcher_context.lock().pending_drivers.iter() { | ||
| log::warn!( | ||
| "Driver {} ({:?}) found but not dispatched.", | ||
| driver.name.as_deref().unwrap_or("Unnamed"), | ||
| guid_fmt!(driver.file_name) | ||
| ); | ||
| } | ||
|
|
||
| // Detail report | ||
| log::warn!("Begin Detail Report:"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Begin Detail Report" is too ambiguous. Please change to something like "Begin Report of Drivers Not Dispatched". |
||
| for driver in self.dispatcher_context.lock().pending_drivers.iter() { | ||
| log::warn!( | ||
| "Driver {} ({:?}) found but not dispatched. Protocols present:", | ||
| driver.name.as_deref().unwrap_or("Unnamed"), | ||
| guid_fmt!(driver.file_name) | ||
| ); | ||
|
|
||
| match &driver.depex { | ||
| Some(depex) => { | ||
| depex.report_protocol_present(); | ||
| } | ||
| _ => { | ||
| log::warn!(" No Depex"); | ||
| } | ||
| } | ||
| } | ||
| log::warn!("End Detail Report."); | ||
| } | ||
|
Comment on lines
+117
to
136
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The messages in this "detailed report" should be at The normal case of a driver not dispatched is already covered by |
||
|
|
||
| /// Initializes the dispatcher by registering for FV protocol installation events. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this at
warnlevel coupled with thepatina_dxe_coretarget 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
infoor a more verbose type if left at thepatina_dxe_coretarget level.But I really think this code should really just return something like an iterator of protocols present for a given
Depexso all logging stays in the caller.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.