diff --git a/Cargo.lock b/Cargo.lock index ed323419d3bb..740eceadeed8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3607,7 +3607,6 @@ dependencies = [ [[package]] name = "neqo-common" version = "0.5.7" -source = "git+https://github.com/mozilla/neqo?tag=v0.5.7#f3de275b12c40f45718ce43a0482e771ba6cd4b8" dependencies = [ "chrono", "env_logger 0.8.999", diff --git a/Cargo.toml b/Cargo.toml index c65557db8382..2b499a084142 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -167,3 +167,8 @@ webext-storage = { git = "https://github.com/mozilla/application-services", rev # There is not going to be new version of mio 0.6, mio now being >= 0.7.11. [patch.crates-io.mio] path = "third_party/rust/mio-0.6.23" + +# Patch neqo 0.5.7 to be compatible with newer versions of the log crate. +# https://github.com/mozilla/neqo/pull/1350 +[patch."https://github.com/mozilla/neqo"] +neqo-common = { path = "third_party/rust/neqo-common" } diff --git a/third_party/rust/neqo-common/src/log.rs b/third_party/rust/neqo-common/src/log.rs index 0573cb45e927..d248f71b793c 100644 --- a/third_party/rust/neqo-common/src/log.rs +++ b/third_party/rust/neqo-common/src/log.rs @@ -13,10 +13,15 @@ macro_rules! do_log { (target: $target:expr, $lvl:expr, $($arg:tt)+) => ({ let lvl = $lvl; if lvl <= ::log::max_level() { - ::log::__private_api_log( - ::log::__log_format_args!($($arg)+), - lvl, - &($target, ::log::__log_module_path!(), ::log::__log_file!(), ::log::__log_line!()), + ::log::logger().log( + &::log::Record::builder() + .args(format_args!($($arg)+)) + .level(lvl) + .target($target) + .module_path_static(Some(module_path!())) + .file_static(Some(file!())) + .line(Some(line!())) + .build() ); } });