Move log to tracing package
Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
parent
fab0b6aa6e
commit
77a821f52b
172
Cargo.lock
generated
172
Cargo.lock
generated
@ -37,6 +37,15 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansi_term"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-attributes"
|
||||
version = "1.1.2"
|
||||
@ -301,6 +310,18 @@ version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "3.1.2"
|
||||
@ -712,7 +733,7 @@ checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"fnv",
|
||||
"itoa",
|
||||
"itoa 0.4.7",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -775,6 +796,12 @@ version = "0.4.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.52"
|
||||
@ -856,6 +883,15 @@ version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"
|
||||
|
||||
[[package]]
|
||||
name = "matchers"
|
||||
version = "0.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1"
|
||||
dependencies = [
|
||||
"regex-automata",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "matches"
|
||||
version = "0.1.9"
|
||||
@ -936,6 +972,25 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.44"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num_cpus"
|
||||
version = "1.13.0"
|
||||
@ -1259,6 +1314,15 @@ dependencies = [
|
||||
"regex-syntax",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
|
||||
dependencies = [
|
||||
"regex-syntax",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.6.25"
|
||||
@ -1363,6 +1427,12 @@ dependencies = [
|
||||
"base64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
|
||||
|
||||
[[package]]
|
||||
name = "schannel"
|
||||
version = "0.1.19"
|
||||
@ -1432,6 +1502,26 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.79"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95"
|
||||
dependencies = [
|
||||
"itoa 1.0.1",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sharded-slab"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signal-hook"
|
||||
version = "0.3.10"
|
||||
@ -1512,9 +1602,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "1.1.2"
|
||||
version = "1.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
|
||||
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
@ -1555,13 +1645,22 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "1.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "99beeb0daeac2bd1e86ac2c21caddecb244b39a093594da1a661ec2060c7aedd"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"itoa 0.4.7",
|
||||
"libc",
|
||||
"time-macros",
|
||||
]
|
||||
@ -1703,6 +1802,49 @@ dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-log"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"log",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-serde"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-subscriber"
|
||||
version = "0.2.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9cbe87a2fa7e35900ce5de20220a582a9483a7063811defce79d7cbd59d4cfe"
|
||||
dependencies = [
|
||||
"ansi_term",
|
||||
"chrono",
|
||||
"lazy_static",
|
||||
"matchers",
|
||||
"regex",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sharded-slab",
|
||||
"smallvec",
|
||||
"thread_local",
|
||||
"tracing",
|
||||
"tracing-core",
|
||||
"tracing-log",
|
||||
"tracing-serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "trust-dns"
|
||||
version = "0.21.2"
|
||||
@ -1710,12 +1852,13 @@ dependencies = [
|
||||
"clap",
|
||||
"env_logger",
|
||||
"futures",
|
||||
"log",
|
||||
"native-tls",
|
||||
"regex",
|
||||
"rustls",
|
||||
"time",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"trust-dns-client",
|
||||
"trust-dns-proto",
|
||||
"trust-dns-resolver",
|
||||
@ -1733,7 +1876,6 @@ dependencies = [
|
||||
"futures-channel",
|
||||
"futures-util",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"openssl",
|
||||
"radix_trie",
|
||||
"rand",
|
||||
@ -1743,6 +1885,8 @@ dependencies = [
|
||||
"thiserror",
|
||||
"time",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"trust-dns-proto",
|
||||
"webpki 0.22.0",
|
||||
]
|
||||
@ -1752,7 +1896,6 @@ name = "trust-dns-compatibility"
|
||||
version = "0.21.2"
|
||||
dependencies = [
|
||||
"data-encoding",
|
||||
"env_logger",
|
||||
"futures",
|
||||
"openssl",
|
||||
"rand",
|
||||
@ -1765,16 +1908,16 @@ name = "trust-dns-integration"
|
||||
version = "0.21.2"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"env_logger",
|
||||
"futures",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"openssl",
|
||||
"rand",
|
||||
"rusqlite",
|
||||
"rustls",
|
||||
"time",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"trust-dns-client",
|
||||
"trust-dns-proto",
|
||||
"trust-dns-resolver",
|
||||
@ -1792,7 +1935,6 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"data-encoding",
|
||||
"enum-as-inner",
|
||||
"env_logger",
|
||||
"futures-channel",
|
||||
"futures-executor",
|
||||
"futures-io",
|
||||
@ -1803,7 +1945,6 @@ dependencies = [
|
||||
"ipnet",
|
||||
"js-sys",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"native-tls",
|
||||
"openssl",
|
||||
"quinn",
|
||||
@ -1820,6 +1961,8 @@ dependencies = [
|
||||
"tokio-native-tls",
|
||||
"tokio-openssl",
|
||||
"tokio-rustls",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"url",
|
||||
"wasm-bindgen",
|
||||
"webpki 0.22.0",
|
||||
@ -1831,12 +1974,10 @@ name = "trust-dns-resolver"
|
||||
version = "0.21.2"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"env_logger",
|
||||
"futures-executor",
|
||||
"futures-util",
|
||||
"ipconfig",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"lru-cache",
|
||||
"parking_lot",
|
||||
"resolv-conf",
|
||||
@ -1848,6 +1989,8 @@ dependencies = [
|
||||
"tokio-native-tls",
|
||||
"tokio-openssl",
|
||||
"tokio-rustls",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"trust-dns-proto",
|
||||
"webpki-roots 0.22.1",
|
||||
]
|
||||
@ -1864,7 +2007,6 @@ dependencies = [
|
||||
"futures-util",
|
||||
"h2",
|
||||
"http",
|
||||
"log",
|
||||
"openssl",
|
||||
"rusqlite",
|
||||
"rustls",
|
||||
@ -1875,6 +2017,8 @@ dependencies = [
|
||||
"tokio-openssl",
|
||||
"tokio-rustls",
|
||||
"toml",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"trust-dns-client",
|
||||
"trust-dns-proto",
|
||||
"trust-dns-resolver",
|
||||
|
@ -76,16 +76,16 @@ path = "src/named.rs"
|
||||
clap = { version = "3.0", default-features = false, features = ["std", "cargo"] }
|
||||
env_logger = "0.9"
|
||||
futures = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
log = "0.4"
|
||||
rustls = { version = "0.20", optional = true }
|
||||
time = "0.3"
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = "0.2"
|
||||
tokio = { version = "1.0", features = ["time"] }
|
||||
trust-dns-client = { version = "0.21.1", path = "../crates/client" }
|
||||
trust-dns-proto = { version = "0.21.1", path = "../crates/proto" }
|
||||
trust-dns-server = { version = "0.21.1", path = "../crates/server" }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.9"
|
||||
native-tls = "0.2"
|
||||
regex = "1.3.4"
|
||||
trust-dns-proto = { version = "0.21.1", path = "../crates/proto", features = ["testing", "dns-over-native-tls"] }
|
||||
|
@ -37,8 +37,6 @@
|
||||
|
||||
#[macro_use]
|
||||
extern crate clap;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
use std::{
|
||||
env,
|
||||
@ -57,6 +55,7 @@ use tokio::{
|
||||
runtime,
|
||||
};
|
||||
|
||||
use tracing::{debug, error, info};
|
||||
use trust_dns_client::rr::Name;
|
||||
#[cfg(feature = "dns-over-tls")]
|
||||
use trust_dns_server::config::dnssec::{self, TlsCertConfig};
|
||||
@ -153,7 +152,9 @@ async fn load_zone(
|
||||
let is_dnssec_enabled = zone_config.is_dnssec_enabled();
|
||||
|
||||
if zone_config.is_update_allowed() {
|
||||
warn!("allow_update is deprecated in [[zones]] section, it belongs in [[zones.stores]]");
|
||||
tracing::warn!(
|
||||
"allow_update is deprecated in [[zones]] section, it belongs in [[zones.stores]]"
|
||||
);
|
||||
}
|
||||
|
||||
// load the zone
|
||||
@ -161,7 +162,9 @@ async fn load_zone(
|
||||
#[cfg(feature = "sqlite")]
|
||||
Some(StoreConfig::Sqlite(ref config)) => {
|
||||
if zone_path.is_some() {
|
||||
warn!("ignoring [[zones.file]] instead using [[zones.stores.zone_file_path]]");
|
||||
tracing::warn!(
|
||||
"ignoring [[zones.file]] instead using [[zones.stores.zone_file_path]]"
|
||||
);
|
||||
}
|
||||
|
||||
let mut authority = SqliteAuthority::try_from_config(
|
||||
@ -180,7 +183,9 @@ async fn load_zone(
|
||||
}
|
||||
Some(StoreConfig::File(ref config)) => {
|
||||
if zone_path.is_some() {
|
||||
warn!("ignoring [[zones.file]] instead using [[zones.stores.zone_file_path]]");
|
||||
tracing::warn!(
|
||||
"ignoring [[zones.file]] instead using [[zones.stores.zone_file_path]]"
|
||||
);
|
||||
}
|
||||
|
||||
let mut authority = FileAuthority::try_from_config(
|
||||
@ -204,7 +209,7 @@ async fn load_zone(
|
||||
}
|
||||
#[cfg(feature = "sqlite")]
|
||||
None if zone_config.is_update_allowed() => {
|
||||
warn!(
|
||||
tracing::warn!(
|
||||
"using deprecated SQLite load configuration, please move to [[zones.stores]] form"
|
||||
);
|
||||
let zone_file_path = zone_path.ok_or("file is a necessary parameter of zone_config")?;
|
||||
@ -574,7 +579,9 @@ fn config_tls(
|
||||
.collect();
|
||||
|
||||
if tls_sockaddrs.is_empty() {
|
||||
warn!("a tls certificate was specified, but no TLS addresses configured to listen on");
|
||||
tracing::warn!(
|
||||
"a tls certificate was specified, but no TLS addresses configured to listen on"
|
||||
);
|
||||
}
|
||||
|
||||
for tls_listener in &tls_sockaddrs {
|
||||
@ -627,7 +634,9 @@ fn config_https(
|
||||
.collect();
|
||||
|
||||
if https_sockaddrs.is_empty() {
|
||||
warn!("a tls certificate was specified, but no HTTPS addresses configured to listen on");
|
||||
tracing::warn!(
|
||||
"a tls certificate was specified, but no HTTPS addresses configured to listen on"
|
||||
);
|
||||
}
|
||||
|
||||
for https_listener in &https_sockaddrs {
|
||||
|
@ -8,9 +8,6 @@
|
||||
#![cfg(not(windows))]
|
||||
#![cfg(feature = "dns-over-https")]
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
mod server_harness;
|
||||
|
||||
use std::env;
|
||||
|
@ -8,9 +8,6 @@
|
||||
#![cfg(not(windows))]
|
||||
#![cfg(feature = "dns-over-rustls")]
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
mod server_harness;
|
||||
|
||||
use std::env;
|
||||
|
@ -1,9 +1,6 @@
|
||||
#![cfg(feature = "dnssec")]
|
||||
#![cfg(not(windows))]
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
mod server_harness;
|
||||
|
||||
use std::env;
|
||||
@ -78,7 +75,7 @@ async fn standard_tcp_conn(
|
||||
|
||||
fn generic_test(config_toml: &str, key_path: &str, key_format: KeyFormat, algorithm: Algorithm) {
|
||||
// use trust_dns_client::logger;
|
||||
// use log::LogLevel;
|
||||
// use tracing::LogLevel;
|
||||
// logger::TrustDnsLogger::enable_logging(LogLevel::Debug);
|
||||
|
||||
let server_path = env::var("TDNS_WORKSPACE_ROOT").unwrap_or_else(|_| "..".to_owned());
|
||||
|
@ -5,9 +5,6 @@
|
||||
// http://opensource.org/licenses/MIT>, at your option. This file may not be
|
||||
// copied, modified, or distributed except according to those terms.
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
mod server_harness;
|
||||
|
||||
use std::io::Write;
|
||||
|
@ -14,6 +14,7 @@ use std::time::*;
|
||||
use regex::Regex;
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
use tracing::info;
|
||||
use trust_dns_client::client::*;
|
||||
use trust_dns_client::proto::xfer::DnsResponse;
|
||||
use trust_dns_client::rr::*;
|
||||
@ -83,7 +84,7 @@ where
|
||||
|
||||
let mut named = named_killer.lock().unwrap();
|
||||
if let Err(e) = named.kill() {
|
||||
warn!("warning: failed to kill named: {:?}", e);
|
||||
tracing::warn!("warning: failed to kill named: {:?}", e);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -74,7 +74,6 @@ data-encoding = "2.2.0"
|
||||
futures-channel = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
futures-util = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
lazy_static = "1.2.0"
|
||||
log = "0.4"
|
||||
openssl = { version = "0.10", features = ["v102", "v110"], optional = true }
|
||||
radix_trie = "0.2.0"
|
||||
rand = "0.8"
|
||||
@ -83,6 +82,7 @@ rustls = { version = "0.20.0", optional = true }
|
||||
serde = { version = "1.0", features = ["derive"], optional = true }
|
||||
thiserror = "1.0.20"
|
||||
time = "0.3"
|
||||
tracing = "0.1"
|
||||
tokio = { version = "1.0", features = ["rt"] }
|
||||
trust-dns-proto = { version = "0.21.1", path = "../proto"}
|
||||
webpki = { version = "0.22.0", optional = true }
|
||||
@ -91,6 +91,7 @@ webpki = { version = "0.22.0", optional = true }
|
||||
futures = { version = "0.3.5", default-features = false, features = ["std", "executor"] }
|
||||
openssl = { version = "0.10", features = ["v102", "v110"], optional = false }
|
||||
tokio = { version = "1.0", features = ["rt", "macros"] }
|
||||
tracing-subscriber = "0.2"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -13,7 +13,7 @@ use std::time::Duration;
|
||||
|
||||
use futures_util::ready;
|
||||
use futures_util::stream::{Stream, StreamExt};
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
use rand;
|
||||
use trust_dns_proto::op::Edns;
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
// copied, modified, or distributed except according to those terms.
|
||||
|
||||
//! signer is a structure for performing many of the signing processes of the DNSSec specification
|
||||
use tracing::debug;
|
||||
|
||||
#[cfg(feature = "dnssec")]
|
||||
use std::time::Duration;
|
||||
|
||||
@ -517,7 +519,7 @@ impl MessageFinalizer for SigSigner {
|
||||
message: &Message,
|
||||
current_time: u32,
|
||||
) -> ProtoResult<(Vec<Record>, Option<MessageVerifier>)> {
|
||||
log::debug!("signing message: {:?}", message);
|
||||
debug!("signing message: {:?}", message);
|
||||
let key_tag: u16 = self.calculate_key_tag()?;
|
||||
|
||||
// this is based on RFCs 2535, 2931 and 3007
|
||||
|
@ -6,6 +6,8 @@
|
||||
// copied, modified, or distributed except according to those terms.
|
||||
|
||||
//! tsigner is a structure for computing tsig messasignuthentication code for dns transactions
|
||||
use tracing::debug;
|
||||
|
||||
use crate::proto::error::{ProtoError, ProtoResult};
|
||||
use crate::proto::rr::dnssec::rdata::tsig::{
|
||||
make_tsig_record, message_tbs, signed_bitmessage_to_buf, TsigAlgorithm, TSIG,
|
||||
@ -173,7 +175,7 @@ impl MessageFinalizer for TSigner {
|
||||
message: &Message,
|
||||
current_time: u32,
|
||||
) -> ProtoResult<(Vec<Record>, Option<MessageVerifier>)> {
|
||||
log::debug!("signing message: {:?}", message);
|
||||
debug!("signing message: {:?}", message);
|
||||
let current_time = current_time as u64;
|
||||
|
||||
let pre_tsig = TSIG::new(
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
//! mail exchange, email, record
|
||||
|
||||
use log::warn;
|
||||
use tracing::warn;
|
||||
|
||||
use crate::proto::rr::rdata::caa;
|
||||
use crate::proto::rr::rdata::caa::{Property, Value};
|
||||
|
@ -85,7 +85,6 @@ idna = "0.2.3"
|
||||
ipnet = "2.3.0"
|
||||
js-sys = { version = "0.3.44", optional = true }
|
||||
lazy_static = "1.2.0"
|
||||
log = "0.4"
|
||||
native-tls = { version = "0.2", optional = true }
|
||||
openssl = { version = "0.10", features = ["v102", "v110"], optional = true }
|
||||
quinn = { version = "0.8.2", optional = true }
|
||||
@ -98,6 +97,7 @@ smallvec = "1.6"
|
||||
socket2 = { version = "0.4.0", optional = true }
|
||||
thiserror = "1.0.20"
|
||||
tinyvec = { version = "1.1.1", features = ["alloc"] }
|
||||
tracing = "0.1"
|
||||
tokio = { version = "1.0", features = ["io-util"], optional = true }
|
||||
tokio-native-tls = { version = "0.3.0", optional = true }
|
||||
tokio-openssl = { version = "0.6.0", optional = true }
|
||||
@ -108,10 +108,10 @@ webpki = { version = "0.22.0", optional = true }
|
||||
webpki-roots = { version = "0.22.1", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.9"
|
||||
futures-executor = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
openssl = { version = "0.10", features = ["v102", "v110"] }
|
||||
tokio = { version = "1.0", features = ["rt", "time", "macros"] }
|
||||
tracing-subscriber = "0.2"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -22,7 +22,7 @@ use futures_util::ready;
|
||||
use futures_util::stream::Stream;
|
||||
use h2::client::{Connection, SendRequest};
|
||||
use http::header::{self, CONTENT_LENGTH};
|
||||
use log::{debug, warn};
|
||||
use tracing::{debug, warn};
|
||||
use rustls::ClientConfig;
|
||||
use tokio_rustls::{
|
||||
client::TlsStream as TokioTlsClientStream, Connect as TokioTlsConnect, TlsConnector,
|
||||
|
@ -17,7 +17,7 @@ use futures_util::stream::{Stream, StreamExt};
|
||||
use h2;
|
||||
use http::header::CONTENT_LENGTH;
|
||||
use http::{Method, Request};
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::https::HttpsError;
|
||||
|
||||
|
@ -11,7 +11,7 @@ use std::str::FromStr;
|
||||
|
||||
use http::header::{ACCEPT, CONTENT_LENGTH, CONTENT_TYPE};
|
||||
use http::{header, uri, Request, Uri, Version};
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::error::ProtoError;
|
||||
use crate::https::HttpsResult;
|
||||
|
@ -15,7 +15,7 @@ use std::task::{Context, Poll};
|
||||
use futures_util::stream::{Stream, StreamExt};
|
||||
use futures_util::{future, future::Future, ready, FutureExt, TryFutureExt};
|
||||
use lazy_static::lazy_static;
|
||||
use log::{debug, trace};
|
||||
use tracing::{debug, trace};
|
||||
use rand;
|
||||
use rand::distributions::{uniform::Uniform, Distribution};
|
||||
use socket2::{self, Socket};
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
use std::{fmt, iter, mem, ops::Deref, sync::Arc};
|
||||
|
||||
use log::{debug, warn};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
use crate::{
|
||||
error::*,
|
||||
|
@ -249,7 +249,7 @@ impl DNSKEY {
|
||||
.emit(&mut encoder)
|
||||
.and_then(|_| emit(&mut encoder, self))
|
||||
{
|
||||
log::warn!("error serializing dnskey: {}", e);
|
||||
tracing::warn!("error serializing dnskey: {}", e);
|
||||
return Err(format!("error serializing dnskey: {}", e).into());
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ pub mod sig;
|
||||
pub mod tsig;
|
||||
|
||||
use enum_as_inner::EnumAsInner;
|
||||
use log::trace;
|
||||
use tracing::trace;
|
||||
|
||||
use crate::error::*;
|
||||
use crate::rr::rdata::null;
|
||||
|
@ -23,7 +23,7 @@ use std::fmt::{Display, Formatter};
|
||||
#[cfg(feature = "serde-config")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use log::warn;
|
||||
use tracing::warn;
|
||||
|
||||
use crate::error::*;
|
||||
use crate::rr::dnssec::Algorithm;
|
||||
|
@ -20,7 +20,7 @@ use std::hash::{Hash, Hasher};
|
||||
use tinyvec::TinyVec;
|
||||
|
||||
use idna;
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::error::*;
|
||||
|
||||
|
@ -21,7 +21,7 @@ use std::collections::HashMap;
|
||||
#[cfg(feature = "serde-config")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use log::warn;
|
||||
use tracing::warn;
|
||||
|
||||
use crate::error::*;
|
||||
use crate::serialize::binary::*;
|
||||
|
@ -19,7 +19,7 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use enum_as_inner::EnumAsInner;
|
||||
use log::{trace, warn};
|
||||
use tracing::{trace, warn};
|
||||
|
||||
use super::domain::Name;
|
||||
use super::rdata;
|
||||
|
@ -8,7 +8,7 @@ use std::iter::Chain;
|
||||
use std::slice::Iter;
|
||||
use std::vec;
|
||||
|
||||
use log::{info, warn};
|
||||
use tracing::{info, warn};
|
||||
|
||||
use crate::rr::{DNSClass, Name, RData, Record, RecordType};
|
||||
|
||||
|
@ -16,7 +16,7 @@ use std::time::Duration;
|
||||
#[cfg(feature = "tokio-runtime")]
|
||||
use async_trait::async_trait;
|
||||
use futures_util::{future::Future, stream::Stream, StreamExt, TryFutureExt};
|
||||
use log::warn;
|
||||
use tracing::warn;
|
||||
|
||||
use crate::error::ProtoError;
|
||||
#[cfg(feature = "tokio-runtime")]
|
||||
|
@ -18,7 +18,7 @@ use async_trait::async_trait;
|
||||
use futures_io::{AsyncRead, AsyncWrite};
|
||||
use futures_util::stream::Stream;
|
||||
use futures_util::{self, future::Future, ready, FutureExt};
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::error::*;
|
||||
use crate::xfer::{SerialMessage, StreamReceiver};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
|
||||
|
||||
use futures_util::stream::StreamExt;
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::udp::{UdpClientStream, UdpSocket, UdpStream};
|
||||
use crate::xfer::dns_handle::DnsStreamHandle;
|
||||
|
@ -15,7 +15,7 @@ use std::task::{Context, Poll};
|
||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||
|
||||
use futures_util::{future::Future, stream::Stream};
|
||||
use log::{debug, warn};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
use crate::error::ProtoError;
|
||||
use crate::op::message::NoopMessageFinalizer;
|
||||
|
@ -14,7 +14,7 @@ use std::task::{Context, Poll};
|
||||
use async_trait::async_trait;
|
||||
use futures_util::stream::Stream;
|
||||
use futures_util::{future::Future, ready, TryFutureExt};
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
use rand;
|
||||
use rand::distributions::{uniform::Uniform, Distribution};
|
||||
|
||||
|
@ -14,7 +14,7 @@ use std::task::{Context, Poll};
|
||||
use futures_channel::mpsc;
|
||||
use futures_util::future::{Future, FutureExt};
|
||||
use futures_util::stream::{Peekable, Stream, StreamExt};
|
||||
use log::{debug, warn};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
use crate::error::*;
|
||||
use crate::xfer::dns_handle::DnsHandle;
|
||||
|
@ -9,7 +9,7 @@
|
||||
use std::error::Error;
|
||||
|
||||
use futures_util::stream::Stream;
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
use rand;
|
||||
|
||||
use crate::op::{Message, MessageType, OpCode, Query};
|
||||
|
@ -20,7 +20,7 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||
use futures_channel::mpsc;
|
||||
use futures_util::stream::{Stream, StreamExt};
|
||||
use futures_util::{future::Future, ready, FutureExt};
|
||||
use log::{debug, warn};
|
||||
use tracing::{debug, warn};
|
||||
use rand;
|
||||
use rand::distributions::{Distribution, Standard};
|
||||
|
||||
|
@ -17,7 +17,7 @@ use futures_util::future;
|
||||
use futures_util::future::{Future, FutureExt, TryFutureExt};
|
||||
use futures_util::stream;
|
||||
use futures_util::stream::{Stream, TryStreamExt};
|
||||
use log::{debug, trace};
|
||||
use tracing::{debug, trace};
|
||||
|
||||
use crate::op::{OpCode, Query};
|
||||
use crate::rr::dnssec::rdata::{DNSSECRData, DNSKEY, SIG};
|
||||
@ -351,16 +351,14 @@ where
|
||||
// on a validation failure?
|
||||
// any error, is an error for all
|
||||
Err(e) => {
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
let mut query = message_result
|
||||
.queries()
|
||||
.iter()
|
||||
.map(|q| q.to_string())
|
||||
.fold(String::new(), |s, q| format!("{},{}", q, s));
|
||||
let mut query = message_result
|
||||
.queries()
|
||||
.iter()
|
||||
.map(|q| q.to_string())
|
||||
.fold(String::new(), |s, q| format!("{},{}", q, s));
|
||||
|
||||
query.truncate(query.len() - 1);
|
||||
debug!("an rrset failed to verify ({}): {:?}", query, e);
|
||||
}
|
||||
query.truncate(query.len() - 1);
|
||||
debug!("an rrset failed to verify ({}): {:?}", query, e);
|
||||
|
||||
last_validation_err = Some(e);
|
||||
}
|
||||
@ -542,12 +540,10 @@ where
|
||||
// must be covered by at least one DS record
|
||||
.any(|(ds_name, ds_rdata)| {
|
||||
if ds_rdata.covers(&rrset.name, key_rdata).unwrap_or(false) {
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
debug!(
|
||||
"validated dnskey ({}, {}) with {} {}",
|
||||
rrset.name, key_rdata, ds_name, ds_rdata
|
||||
);
|
||||
}
|
||||
debug!(
|
||||
"validated dnskey ({}, {}) with {} {}",
|
||||
rrset.name, key_rdata, ds_name, ds_rdata
|
||||
);
|
||||
true
|
||||
} else {
|
||||
false
|
||||
@ -801,22 +797,18 @@ fn verify_rrset_with_dnskey(
|
||||
dnskey
|
||||
.verify_rrsig(&rrset.name, rrset.record_class, sig, &rrset.records)
|
||||
.map(|r| {
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
debug!(
|
||||
"validated ({}, {:?}) with ({}, {})",
|
||||
rrset.name, rrset.record_type, dnskey_name, dnskey
|
||||
)
|
||||
}
|
||||
debug!(
|
||||
"validated ({}, {:?}) with ({}, {})",
|
||||
rrset.name, rrset.record_type, dnskey_name, dnskey
|
||||
);
|
||||
r
|
||||
})
|
||||
.map_err(Into::into)
|
||||
.map_err(|e| {
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
debug!(
|
||||
"failed validation of ({}, {:?}) with ({}, {})",
|
||||
rrset.name, rrset.record_type, dnskey_name, dnskey
|
||||
)
|
||||
}
|
||||
debug!(
|
||||
"failed validation of ({}, {:?}) with ({}, {})",
|
||||
rrset.name, rrset.record_type, dnskey_name, dnskey
|
||||
);
|
||||
|
||||
e
|
||||
})
|
||||
|
@ -14,7 +14,7 @@ use futures_channel::oneshot;
|
||||
use futures_util::future::Future;
|
||||
use futures_util::ready;
|
||||
use futures_util::stream::{Fuse, Peekable, Stream, StreamExt};
|
||||
use log::{debug, warn};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
use crate::error::*;
|
||||
use crate::Time;
|
||||
|
@ -74,18 +74,17 @@ backtrace = { version = "0.3.50", optional = true }
|
||||
bytes = "1"
|
||||
cfg-if = "1"
|
||||
enum-as-inner = "0.3"
|
||||
env_logger = "0.9"
|
||||
futures-executor = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
futures-util = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
h2 = { version = "0.3.0", features = ["stream"], optional = true }
|
||||
http = { version = "0.2", optional = true }
|
||||
log = "0.4"
|
||||
openssl = { version = "0.10", features = ["v102", "v110"], optional = true }
|
||||
rusqlite = { version = "0.26.1", features = ["bundled", "time"], optional = true }
|
||||
rustls = { version = "0.20", optional = true }
|
||||
serde = { version = "1.0.114", features = ["derive"] }
|
||||
thiserror = "1.0.20"
|
||||
time = "0.3"
|
||||
tracing = "0.1"
|
||||
tokio = { version = "1.0", features = ["net"] }
|
||||
tokio-openssl = { version = "0.6.0", optional = true }
|
||||
tokio-rustls = { version = "0.23.0", optional = true }
|
||||
@ -95,6 +94,7 @@ trust-dns-resolver = { version = "0.21.1-alpha.5", path = "../resolver", feature
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version="1.0", features = ["macros", "rt"] }
|
||||
tracing-subscriber = "0.2"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -72,7 +72,6 @@ path = "src/lib.rs"
|
||||
cfg-if = "1.0.0"
|
||||
futures-util = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
lazy_static = "1.2.0"
|
||||
log = "0.4"
|
||||
lru-cache = "0.1.2"
|
||||
parking_lot = "0.12"
|
||||
resolv-conf = { version = "0.7.0", optional = true, features = ["system"] }
|
||||
@ -80,6 +79,7 @@ rustls = { version = "0.20.0", optional = true }
|
||||
serde = { version = "1.0", features = ["derive"], optional = true }
|
||||
smallvec = "1.6"
|
||||
thiserror = "1.0.20"
|
||||
tracing = "0.1"
|
||||
tokio = { version = "1.0", optional = true }
|
||||
tokio-native-tls = { version = "0.3", optional = true }
|
||||
tokio-openssl = { version = "0.6.0", optional = true }
|
||||
@ -91,8 +91,8 @@ webpki-roots = { version = "0.22.1", optional = true }
|
||||
ipconfig = { version = "0.3.0", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.9"
|
||||
futures-executor = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
tracing-subscriber = "0.2"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -8,7 +8,8 @@ fn main() {
|
||||
use tokio::runtime::Runtime;
|
||||
use trust_dns_resolver::{TokioAsyncResolver, TokioHandle};
|
||||
|
||||
env_logger::init();
|
||||
let subscriber = tracing_subscriber::FmtSubscriber::builder().finish();
|
||||
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
|
||||
|
||||
// Set up the standard tokio runtime (multithreaded by default).
|
||||
let runtime = Runtime::new().expect("Failed to create runtime");
|
||||
|
@ -19,6 +19,7 @@ use proto::rr::domain::TryParseIp;
|
||||
use proto::rr::{IntoName, Name, Record, RecordType};
|
||||
use proto::xfer::{DnsRequestOptions, RetryDnsHandle};
|
||||
use proto::DnsHandle;
|
||||
use tracing::{debug, trace};
|
||||
|
||||
use crate::caching_client::CachingClient;
|
||||
use crate::config::{ResolverConfig, ResolverOpts};
|
||||
@ -227,7 +228,7 @@ impl<C: DnsHandle<Error = ResolveError>, P: ConnectionProvider<Conn = C>> AsyncR
|
||||
#[cfg(not(feature = "dnssec"))]
|
||||
{
|
||||
// TODO: should this just be a panic, or a pinned error?
|
||||
warn!("validate option is only available with 'dnssec' feature");
|
||||
tracing::warn!("validate option is only available with 'dnssec' feature");
|
||||
either = LookupEither::Retry(client);
|
||||
}
|
||||
} else {
|
||||
|
@ -11,6 +11,7 @@ use std::cmp::Ordering;
|
||||
use std::{fmt, io, sync};
|
||||
|
||||
use thiserror::Error;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::proto::error::{ProtoError, ProtoErrorKind};
|
||||
use crate::proto::op::{Query, ResponseCode};
|
||||
|
@ -74,7 +74,7 @@ impl Hosts {
|
||||
Lookup::new_with_max_ttl(query, Arc::from([]))
|
||||
}),
|
||||
_ => {
|
||||
warn!("unsupported IP type from Hosts file: {:#?}", record_type);
|
||||
tracing::warn!("unsupported IP type from Hosts file: {:#?}", record_type);
|
||||
return;
|
||||
}
|
||||
};
|
||||
@ -86,7 +86,7 @@ impl Hosts {
|
||||
match record_type {
|
||||
RecordType::A => lookup_type.a = Some(new_lookup),
|
||||
RecordType::AAAA => lookup_type.aaaa = Some(new_lookup),
|
||||
_ => warn!("unsupported IP type from Hosts file"),
|
||||
_ => tracing::warn!("unsupported IP type from Hosts file"),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,8 +250,6 @@
|
||||
extern crate cfg_if;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[cfg(feature = "serde-config")]
|
||||
#[macro_use]
|
||||
extern crate serde;
|
||||
|
@ -22,6 +22,7 @@ use proto::error::ProtoError;
|
||||
use proto::op::Query;
|
||||
use proto::rr::{Name, RData, Record, RecordType};
|
||||
use proto::xfer::{DnsHandle, DnsRequestOptions};
|
||||
use tracing::debug;
|
||||
|
||||
use crate::caching_client::CachingClient;
|
||||
use crate::config::LookupIpStrategy;
|
||||
|
@ -17,6 +17,7 @@ use futures_util::stream::{once, Stream};
|
||||
#[cfg(feature = "mdns")]
|
||||
use proto::multicast::MDNS_IPV4;
|
||||
use proto::xfer::{DnsHandle, DnsRequest, DnsResponse, FirstAnswer};
|
||||
use tracing::debug;
|
||||
|
||||
#[cfg(feature = "mdns")]
|
||||
use crate::config::Protocol;
|
||||
|
@ -17,6 +17,7 @@ use smallvec::SmallVec;
|
||||
|
||||
use proto::xfer::{DnsHandle, DnsRequest, DnsResponse, FirstAnswer};
|
||||
use proto::Time;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::config::{ResolverConfig, ResolverOpts};
|
||||
use crate::error::{ResolveError, ResolveErrorKind};
|
||||
@ -509,8 +510,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_multi_use_conns() {
|
||||
env_logger::try_init().ok();
|
||||
|
||||
let io_loop = Runtime::new().unwrap();
|
||||
let conn_provider = TokioConnectionProvider::new(TokioHandle);
|
||||
|
||||
|
@ -80,7 +80,7 @@ fn into_resolver_config(
|
||||
});
|
||||
}
|
||||
if nameservers.is_empty() {
|
||||
warn!("no nameservers found in config");
|
||||
tracing::warn!("no nameservers found in config");
|
||||
}
|
||||
|
||||
// search
|
||||
|
@ -83,13 +83,13 @@ futures-executor = { version = "0.3.5", default-features = false, features = ["s
|
||||
futures-util = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
h2 = { version = "0.3.0", features = ["stream"], optional = true }
|
||||
http = { version = "0.2", optional = true }
|
||||
log = "0.4"
|
||||
openssl = { version = "0.10", features = ["v102", "v110"], optional = true }
|
||||
rusqlite = { version = "0.27.0", features = ["bundled", "time"], optional = true }
|
||||
rustls = { version = "0.20", optional = true }
|
||||
serde = { version = "1.0.114", features = ["derive"] }
|
||||
thiserror = "1.0.20"
|
||||
time = "0.3"
|
||||
tracing = "0.1"
|
||||
tokio = { version = "1.0", features = ["net", "sync"] }
|
||||
tokio-openssl = { version = "0.6.0", optional = true }
|
||||
tokio-rustls = { version = "0.23.0", optional = true }
|
||||
@ -100,6 +100,7 @@ trust-dns-resolver = { version = "0.21.1", path = "../resolver", features = ["se
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version="1.0", features = ["macros", "rt"] }
|
||||
tracing-subscriber = "0.2"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::{
|
||||
authority::{Authority, LookupError, LookupOptions, MessageRequest, UpdateResult, ZoneType},
|
||||
|
@ -11,7 +11,7 @@
|
||||
use std::{borrow::Borrow, collections::HashMap, future::Future, io};
|
||||
|
||||
use cfg_if::cfg_if;
|
||||
use log::{debug, error, info, trace, warn};
|
||||
use tracing::{debug, error, info, trace, warn};
|
||||
use trust_dns_proto::rr::Record;
|
||||
|
||||
#[cfg(feature = "dnssec")]
|
||||
|
@ -260,7 +260,7 @@ impl TlsCertConfig {
|
||||
/// keys = [ "my_rsa_2048|RSASHA256", "/path/to/my_ed25519|ED25519" ]
|
||||
#[cfg(feature = "dnssec")]
|
||||
fn load_key(zone_name: Name, key_config: &KeyConfig) -> Result<SigSigner, String> {
|
||||
use log::info;
|
||||
use tracing::info;
|
||||
|
||||
use std::convert::TryInto;
|
||||
use std::fs::File;
|
||||
@ -318,7 +318,7 @@ pub fn load_cert(
|
||||
zone_dir: &Path,
|
||||
tls_cert_config: &TlsCertConfig,
|
||||
) -> Result<((X509, Option<Stack<X509>>), PKey<Private>), String> {
|
||||
use log::{info, warn};
|
||||
use tracing::{info, warn};
|
||||
|
||||
use crate::proto::openssl::tls_server::{
|
||||
read_cert_pem, read_cert_pkcs12, read_key_from_der, read_key_from_pkcs8,
|
||||
@ -377,7 +377,7 @@ pub fn load_cert(
|
||||
zone_dir: &Path,
|
||||
tls_cert_config: &TlsCertConfig,
|
||||
) -> Result<(Vec<Certificate>, PrivateKey), String> {
|
||||
use log::{info, warn};
|
||||
use tracing::{info, warn};
|
||||
|
||||
use crate::proto::rustls::tls_server::{read_cert, read_key, read_key_from_der};
|
||||
|
||||
|
@ -17,7 +17,6 @@ use std::str::FromStr;
|
||||
use std::time::Duration;
|
||||
|
||||
use cfg_if::cfg_if;
|
||||
use log;
|
||||
use serde::{self, Deserialize};
|
||||
use toml;
|
||||
|
||||
@ -120,18 +119,18 @@ impl Config {
|
||||
}
|
||||
|
||||
/// specify the log level which should be used, ["Trace", "Debug", "Info", "Warn", "Error"]
|
||||
pub fn get_log_level(&self) -> log::Level {
|
||||
pub fn get_log_level(&self) -> tracing::Level {
|
||||
if let Some(ref level_str) = self.log_level {
|
||||
match level_str as &str {
|
||||
"Trace" => log::Level::Trace,
|
||||
"Debug" => log::Level::Debug,
|
||||
"Info" => log::Level::Info,
|
||||
"Warn" => log::Level::Warn,
|
||||
"Error" => log::Level::Error,
|
||||
_ => log::Level::Info,
|
||||
"Trace" => tracing::Level::TRACE,
|
||||
"Debug" => tracing::Level::DEBUG,
|
||||
"Info" => tracing::Level::INFO,
|
||||
"Warn" => tracing::Level::WARN,
|
||||
"Error" => tracing::Level::ERROR,
|
||||
_ => tracing::Level::INFO,
|
||||
}
|
||||
} else {
|
||||
log::Level::Info
|
||||
tracing::Level::INFO
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ use std::{io, net::SocketAddr, sync::Arc};
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use futures_util::lock::Mutex;
|
||||
use h2::server;
|
||||
use log::{debug, warn};
|
||||
use tracing::{debug, warn};
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use trust_dns_proto::rr::Record;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
use std::{io, net::SocketAddr};
|
||||
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
use trust_dns_proto::rr::Record;
|
||||
|
||||
use crate::{
|
||||
|
@ -11,11 +11,11 @@ use std::{
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use futures_util::{future, StreamExt};
|
||||
use log::{debug, info, warn};
|
||||
use futures_util::{future, lock::Mutex, StreamExt};
|
||||
#[cfg(feature = "dns-over-rustls")]
|
||||
use rustls::{Certificate, PrivateKey};
|
||||
use tokio::{net, task::JoinHandle};
|
||||
use tracing::{debug, info, warn};
|
||||
use trust_dns_proto::rr::Record;
|
||||
|
||||
#[cfg(all(feature = "dns-over-openssl", not(feature = "dns-over-rustls")))]
|
||||
|
@ -6,7 +6,7 @@ use std::time::Duration;
|
||||
|
||||
use futures_util::stream::{Stream, StreamExt};
|
||||
use futures_util::FutureExt;
|
||||
use log::{debug, warn};
|
||||
use tracing::{debug, warn};
|
||||
use tokio::time::Sleep;
|
||||
|
||||
/// This wraps the underlying Stream in a timeout.
|
||||
|
@ -15,7 +15,7 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use log::{debug, info};
|
||||
use tracing::{debug, info};
|
||||
|
||||
#[cfg(feature = "dnssec")]
|
||||
use crate::{
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
use std::io;
|
||||
|
||||
use log::{debug, info};
|
||||
use tracing::{debug, info};
|
||||
use trust_dns_proto::xfer::DnsRequestOptions;
|
||||
|
||||
use crate::{
|
||||
@ -70,7 +70,7 @@ impl ForwardAuthority {
|
||||
// preserve_intemediates enables when set to true, and disables
|
||||
// when set to false. So we set it to true.
|
||||
if !options.preserve_intermediates {
|
||||
log::warn!(
|
||||
tracing::warn!(
|
||||
"preserve_intermediates set to false, which is invalid \
|
||||
for a forwarder; switching to true"
|
||||
);
|
||||
|
@ -16,7 +16,7 @@ use std::{
|
||||
|
||||
use cfg_if::cfg_if;
|
||||
use futures_util::future::{self, TryFutureExt};
|
||||
use log::{debug, error, warn};
|
||||
use tracing::{debug, error, warn};
|
||||
|
||||
use tokio::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard};
|
||||
|
||||
@ -1100,7 +1100,7 @@ impl Authority for InMemoryAuthority {
|
||||
// if DNSSEC is enabled, and the request had the DO set, sign the recordset
|
||||
#[cfg(feature = "dnssec")]
|
||||
{
|
||||
use log::warn;
|
||||
use tracing::warn;
|
||||
|
||||
// ANAME's are constructed on demand, so need to be signed before return
|
||||
if lookup_options.is_dnssec() {
|
||||
|
@ -14,7 +14,7 @@ use std::{
|
||||
};
|
||||
|
||||
use futures_util::lock::Mutex;
|
||||
use log::{error, info, warn};
|
||||
use tracing::{error, info, warn};
|
||||
|
||||
use crate::{
|
||||
authority::{Authority, LookupError, LookupOptions, MessageRequest, UpdateResult, ZoneType},
|
||||
@ -450,7 +450,7 @@ impl SqliteAuthority {
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "dnssec")))]
|
||||
#[allow(clippy::blocks_in_if_conditions)]
|
||||
pub async fn authorize(&self, update_message: &MessageRequest) -> UpdateResult<()> {
|
||||
use log::debug;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::client::rr::rdata::DNSSECRData;
|
||||
use crate::proto::rr::dnssec::Verifier;
|
||||
|
@ -11,7 +11,7 @@ use std::iter::Iterator;
|
||||
use std::path::Path;
|
||||
use std::sync::{Mutex, MutexGuard};
|
||||
|
||||
use log::error;
|
||||
use tracing::error;
|
||||
use rusqlite::types::ToSql;
|
||||
use rusqlite::{self, Connection};
|
||||
use time;
|
||||
|
@ -38,7 +38,7 @@ fn test_read_config() {
|
||||
assert_eq!(config.get_listen_addrs_ipv4(), Vec::<Ipv4Addr>::new());
|
||||
assert_eq!(config.get_listen_addrs_ipv6(), Vec::<Ipv6Addr>::new());
|
||||
assert_eq!(config.get_tcp_request_timeout(), Duration::from_secs(5));
|
||||
assert_eq!(config.get_log_level(), log::Level::Info);
|
||||
assert_eq!(config.get_log_level(), tracing::Level::INFO);
|
||||
assert_eq!(config.get_directory(), Path::new("/var/named"));
|
||||
assert_eq!(
|
||||
config.get_zones(),
|
||||
@ -141,7 +141,7 @@ fn test_parse_toml() {
|
||||
assert_eq!(config.get_tcp_request_timeout(), Duration::from_secs(25));
|
||||
|
||||
let config: Config = "log_level = \"Debug\"".parse().unwrap();
|
||||
assert_eq!(config.get_log_level(), log::Level::Debug);
|
||||
assert_eq!(config.get_log_level(), tracing::Level::DEBUG);
|
||||
|
||||
let config: Config = "directory = \"/dev/null\"".parse().unwrap();
|
||||
assert_eq!(config.get_directory(), Path::new("/dev/null"));
|
||||
|
@ -47,7 +47,6 @@ path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
data-encoding = "2.2.0"
|
||||
env_logger = "0.9"
|
||||
futures = "0.3.5"
|
||||
openssl = { version = "0.10", features = ["v102", "v110"] }
|
||||
rand = "0.8"
|
||||
|
@ -71,15 +71,15 @@ sqlite = ["rusqlite", "trust-dns-server/sqlite"]
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1.43"
|
||||
env_logger = "0.9"
|
||||
lazy_static = "1.2.0"
|
||||
log = "0.4"
|
||||
futures = "0.3.5"
|
||||
openssl = { version = "0.10", features = ["v102", "v110"] }
|
||||
rand = "0.8"
|
||||
rusqlite = { version = "0.27.0", features = ["bundled"], optional = true }
|
||||
rustls = "0.20"
|
||||
time = "0.3"
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = "0.2"
|
||||
tokio = { version = "1.0", features = ["time", "rt"] }
|
||||
trust-dns-client= { version = "0.21.1", path = "../../crates/client" }
|
||||
trust-dns-proto = { version = "0.21.1", path = "../../crates/proto", features = ["testing"] }
|
||||
|
@ -27,7 +27,6 @@ use std::str::FromStr;
|
||||
|
||||
use clap::{Arg, ArgMatches, Command};
|
||||
use data_encoding::BASE64;
|
||||
use log::info;
|
||||
use openssl::bn::BigNum;
|
||||
use openssl::rsa::Rsa;
|
||||
|
||||
@ -65,7 +64,7 @@ pub fn main() {
|
||||
let key_path = matches.value_of("key").unwrap();
|
||||
let output_path = matches.value_of("output").unwrap();
|
||||
|
||||
info!("Reading private key: {}", key_path);
|
||||
log::info!("Reading private key: {}", key_path);
|
||||
|
||||
let key_file = File::open(key_path).expect("private key file could not be opened");
|
||||
|
||||
@ -110,7 +109,7 @@ pub fn main() {
|
||||
_ => panic!("Algorithm currently not supported: {:?}", algorithm),
|
||||
};
|
||||
|
||||
info!("Writing private key to pem: {}", output_path);
|
||||
log::info!("Writing private key to pem: {}", output_path);
|
||||
let mut file = OpenOptions::new()
|
||||
.create_new(true)
|
||||
.write(true)
|
||||
|
@ -24,7 +24,6 @@ use std::fs::{File, OpenOptions};
|
||||
use std::io::{BufReader, Read, Write};
|
||||
|
||||
use clap::{Arg, ArgMatches, Command};
|
||||
use log::info;
|
||||
use openssl::pkey::PKey;
|
||||
|
||||
use trust_dns_client::rr::dnssec::{KeyPair, Public};
|
||||
@ -63,7 +62,7 @@ pub fn main() {
|
||||
let key_path = matches.value_of("key").unwrap();
|
||||
let output_path = matches.value_of("output").unwrap();
|
||||
|
||||
info!("Reading key from pem: {}", key_path);
|
||||
log::info!("Reading key from pem: {}", key_path);
|
||||
|
||||
let mut key_file = File::open(key_path).expect("private key file could not be opened");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user