mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 03:26:10 +08:00
Use log, env_logger crates to log warnings instead of using eprintln!() macro
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -467,7 +467,9 @@ dependencies = [
|
||||
name = "graphui-rs"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"gtk4",
|
||||
"log",
|
||||
"pipewire",
|
||||
]
|
||||
|
||||
|
||||
@@ -9,3 +9,6 @@ edition = "2018"
|
||||
[dependencies]
|
||||
pipewire = { git = "https://gitlab.freedesktop.org/gdesmott/pipewire-rs", branch = "proxies"}
|
||||
gtk = { git = "https://github.com/gtk-rs/gtk4-rs/", package = "gtk4" }
|
||||
|
||||
log = "0.4.11"
|
||||
env_logger = "0.8.2"
|
||||
|
||||
@@ -15,7 +15,9 @@ pub struct PipewireLink {
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
env_logger::init();
|
||||
gtk::init()?;
|
||||
|
||||
let graphview = Rc::new(RefCell::new(view::GraphView::new()));
|
||||
|
||||
// Create the connection to the pipewire server and do an initial roundtrip before showing the view,
|
||||
|
||||
@@ -145,8 +145,7 @@ impl PipewireState {
|
||||
|
||||
self.items.remove(&id);
|
||||
} else {
|
||||
// FIXME: Switch to log macro
|
||||
eprintln!(
|
||||
log::warn!(
|
||||
"Attempted to remove item with id {} that is not saved in state",
|
||||
id
|
||||
);
|
||||
|
||||
@@ -124,8 +124,7 @@ mod imp {
|
||||
cr.curve_to(from_x + 75.0, from_y, to_x - 75.0, to_y, to_x, to_y);
|
||||
cr.stroke();
|
||||
} else {
|
||||
eprintln!("Could not get allocation of ports of link: {:?}", link);
|
||||
// FIXME: Log an info instead.
|
||||
log::warn!("Could not get allocation of ports of link: {:?}", link);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,9 +219,10 @@ impl GraphView {
|
||||
node.add_port(port_id, port);
|
||||
} else {
|
||||
// FIXME: Log this instead
|
||||
eprintln!(
|
||||
log::error!(
|
||||
"Node with id {} not found when trying to add port with id {} to graph",
|
||||
node_id, port_id
|
||||
node_id,
|
||||
port_id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user