diff --git a/Cargo.lock b/Cargo.lock index 3434a6a..212a4bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -240,6 +240,7 @@ dependencies = [ "event-listener", "futures", "gettext-rs", + "glib", "glib-build-tools", "gtk4", "http-cache", @@ -1085,6 +1086,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", + "log", "memchr", "smallvec", ] diff --git a/Cargo.toml b/Cargo.toml index 4491829..09fd8b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ color-thief = "0.2.2" event-listener = "5.3.1" futures = "0.3.31" 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"] } http-cache = { version = "0.20.0", default-features = false, features = [ "cacache", diff --git a/src/main.rs b/src/main.rs index 188624c..2431a46 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,6 +34,9 @@ fn main() -> glib::ExitCode { 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"); init_tracing();