diff --git a/glib/src/bridged_logging.rs b/glib/src/bridged_logging.rs index 17ca1e8f7e31..1a34bdb76f85 100644 --- a/glib/src/bridged_logging.rs +++ b/glib/src/bridged_logging.rs @@ -217,10 +217,12 @@ impl rs_log::Log for GlibLogger { } GlibLoggerFormat::Structured => { let args = record.args(); + let args_str; let message = if let Some(s) = args.as_str() { s } else { - &args.to_string() + args_str = args.to_string(); + &args_str }; GlibLogger::write_log_structured( domain,