make glib use log crate

This commit is contained in:
Erica Z 2024-11-25 12:48:16 +01:00
parent a33fe4ba63
commit 1d9ff83724
3 changed files with 6 additions and 0 deletions

2
Cargo.lock generated
View file

@ -240,6 +240,7 @@ dependencies = [
"event-listener", "event-listener",
"futures", "futures",
"gettext-rs", "gettext-rs",
"glib",
"glib-build-tools", "glib-build-tools",
"gtk4", "gtk4",
"http-cache", "http-cache",
@ -1085,6 +1086,7 @@ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
"libc", "libc",
"log",
"memchr", "memchr",
"smallvec", "smallvec",
] ]

View file

@ -11,6 +11,7 @@ color-thief = "0.2.2"
event-listener = "5.3.1" event-listener = "5.3.1"
futures = "0.3.31" futures = "0.3.31"
gettext-rs = { version = "0.7.2", features = ["gettext-system"] } gettext-rs = { version = "0.7.2", features = ["gettext-system"] }
glib = { version = "0.20.6", features = ["log", "v2_82"] }
gtk = { version = "0.9.2", package = "gtk4", features = ["v4_16"] } gtk = { version = "0.9.2", package = "gtk4", features = ["v4_16"] }
http-cache = { version = "0.20.0", default-features = false, features = [ http-cache = { version = "0.20.0", default-features = false, features = [
"cacache", "cacache",

View file

@ -34,6 +34,9 @@ fn main() -> glib::ExitCode {
std::process::exit(1); std::process::exit(1);
})); }));
// route glib log messages to the log crate
glib::log_set_default_handler(glib::rust_log_handler);
gio::resources_register_include!("audrey.gresource").expect("could not register resources"); gio::resources_register_include!("audrey.gresource").expect("could not register resources");
init_tracing(); init_tracing();