mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 13:50:16 +00:00
fix(log): swap everything to use logging
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
use crate::context::SproutContext;
|
use crate::context::SproutContext;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use log::info;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
@@ -13,6 +14,6 @@ pub struct PrintConfiguration {
|
|||||||
|
|
||||||
/// Executes the print action with the specified `configuration` inside the provided `context`.
|
/// Executes the print action with the specified `configuration` inside the provided `context`.
|
||||||
pub fn print(context: Rc<SproutContext>, configuration: &PrintConfiguration) -> Result<()> {
|
pub fn print(context: Rc<SproutContext>, configuration: &PrintConfiguration) -> Result<()> {
|
||||||
println!("{}", context.stamp(&configuration.text));
|
info!("{}", context.stamp(&configuration.text));
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/menu.rs
10
src/menu.rs
@@ -1,5 +1,6 @@
|
|||||||
use crate::entries::BootableEntry;
|
use crate::entries::BootableEntry;
|
||||||
use anyhow::{Context, Result, bail};
|
use anyhow::{Context, Result, bail};
|
||||||
|
use log::info;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use uefi::ResultExt;
|
use uefi::ResultExt;
|
||||||
use uefi::boot::TimerTrigger;
|
use uefi::boot::TimerTrigger;
|
||||||
@@ -93,10 +94,10 @@ fn select_with_input<'a>(
|
|||||||
// If the timeout is not zero, let's display the boot menu.
|
// If the timeout is not zero, let's display the boot menu.
|
||||||
if !timeout.is_zero() {
|
if !timeout.is_zero() {
|
||||||
// Until a pretty menu is available, we just print all the entries.
|
// Until a pretty menu is available, we just print all the entries.
|
||||||
println!("Boot Menu:");
|
info!("Boot Menu:");
|
||||||
for (index, entry) in entries.iter().enumerate() {
|
for (index, entry) in entries.iter().enumerate() {
|
||||||
let title = entry.context().stamp(&entry.declaration().title);
|
let title = entry.context().stamp(&entry.declaration().title);
|
||||||
println!(" [{}] {} ({})", index, title, entry.name());
|
info!(" [{}] {} ({})", index, title, entry.name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,9 +108,8 @@ fn select_with_input<'a>(
|
|||||||
break MenuOperation::Exit;
|
break MenuOperation::Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
println!();
|
info!("Select a boot entry using the number keys.");
|
||||||
println!("Select a boot entry using the number keys.");
|
info!("Press Escape to exit and enter to display the entries again.");
|
||||||
println!("Press Escape to exit and enter to display the entries again.");
|
|
||||||
|
|
||||||
let operation = read(input, &timeout)?;
|
let operation = read(input, &timeout)?;
|
||||||
if operation != MenuOperation::Nop {
|
if operation != MenuOperation::Nop {
|
||||||
|
|||||||
Reference in New Issue
Block a user