Bug 1774513 - Fix neqo-common compatibility with log >= 0.4.16. r=necko-reviewers,dragana

Differential Revision: https://phabricator.services.mozilla.com/D149464
This commit is contained in:
Mike Hommey 2022-06-23 20:31:56 +00:00
Родитель 9a4bc45bba
Коммит 9e2c3b1a7f
3 изменённых файлов: 14 добавлений и 5 удалений

1
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",

Просмотреть файл

@ -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" }

13
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()
);
}
});