Skip to content

Commit 00a31c9

Browse files
committed
Patch for libtelio
Reduce log levels from error and warn to debug. These changes are copied from 0be935b commit.
1 parent 9f344b5 commit 00a31c9

File tree

28 files changed

+94
-94
lines changed

28 files changed

+94
-94
lines changed

bin/src/named.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use tokio::{
5151
net::{TcpListener, UdpSocket},
5252
runtime,
5353
};
54-
use tracing::{debug, error, info, warn, Event, Subscriber};
54+
use tracing::{debug, info, Event, Subscriber};
5555
use tracing_subscriber::{
5656
fmt::{format, FmtContext, FormatEvent, FormatFields, FormattedFields},
5757
layer::SubscriberExt,
@@ -157,15 +157,15 @@ async fn load_zone(
157157
let is_dnssec_enabled = zone_config.is_dnssec_enabled();
158158

159159
if zone_config.is_update_allowed() {
160-
warn!("allow_update is deprecated in [[zones]] section, it belongs in [[zones.stores]]");
160+
debug!("allow_update is deprecated in [[zones]] section, it belongs in [[zones.stores]]");
161161
}
162162

163163
// load the zone
164164
let authority: Box<dyn AuthorityObject> = match zone_config.stores {
165165
#[cfg(feature = "sqlite")]
166166
Some(StoreConfig::Sqlite(ref config)) => {
167167
if zone_path.is_some() {
168-
warn!("ignoring [[zones.file]] instead using [[zones.stores.zone_file_path]]");
168+
debug!("ignoring [[zones.file]] instead using [[zones.stores.zone_file_path]]");
169169
}
170170

171171
let mut authority = SqliteAuthority::try_from_config(
@@ -184,7 +184,7 @@ async fn load_zone(
184184
}
185185
Some(StoreConfig::File(ref config)) => {
186186
if zone_path.is_some() {
187-
warn!("ignoring [[zones.file]] instead using [[zones.stores.zone_file_path]]");
187+
debug!("ignoring [[zones.file]] instead using [[zones.stores.zone_file_path]]");
188188
}
189189

190190
let mut authority = FileAuthority::try_from_config(
@@ -215,7 +215,7 @@ async fn load_zone(
215215
}
216216
#[cfg(feature = "sqlite")]
217217
None if zone_config.is_update_allowed() => {
218-
warn!(
218+
debug!(
219219
"using deprecated SQLite load configuration, please move to [[zones.stores]] form"
220220
);
221221
let zone_file_path = zone_path.ok_or("file is a necessary parameter of zone_config")?;
@@ -559,7 +559,7 @@ fn main() {
559559
e
560560
);
561561

562-
error!("{}", error_msg);
562+
debug!("{}", error_msg);
563563
panic!("{}", error_msg);
564564
}
565565
};
@@ -586,7 +586,7 @@ fn config_tls(
586586
.collect();
587587

588588
if tls_sockaddrs.is_empty() {
589-
warn!("a tls certificate was specified, but no TLS addresses configured to listen on");
589+
debug!("a tls certificate was specified, but no TLS addresses configured to listen on");
590590
}
591591

592592
for tls_listener in &tls_sockaddrs {
@@ -639,7 +639,7 @@ fn config_https(
639639
.collect();
640640

641641
if https_sockaddrs.is_empty() {
642-
warn!("a tls certificate was specified, but no HTTPS addresses configured to listen on");
642+
debug!("a tls certificate was specified, but no HTTPS addresses configured to listen on");
643643
}
644644

645645
for https_listener in &https_sockaddrs {
@@ -698,7 +698,7 @@ fn config_quic(
698698
.collect();
699699

700700
if quic_sockaddrs.is_empty() {
701-
warn!("a tls certificate was specified, but no QUIC addresses configured to listen on");
701+
debug!("a tls certificate was specified, but no QUIC addresses configured to listen on");
702702
}
703703

704704
for quic_listener in &quic_sockaddrs {

bin/tests/server_harness/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::time::*;
1414
use regex::Regex;
1515
use tokio::runtime::Runtime;
1616

17-
use tracing::{info, warn};
17+
use tracing::{debug, info};
1818
use trust_dns_client::client::*;
1919
use trust_dns_client::proto::xfer::DnsResponse;
2020
use trust_dns_client::rr::*;
@@ -84,7 +84,7 @@ where
8484

8585
let mut named = named_killer.lock().unwrap();
8686
if let Err(e) = named.kill() {
87-
warn!("warning: failed to kill named: {:?}", e);
87+
debug!("warning: failed to kill named: {:?}", e);
8888
}
8989
};
9090

crates/client/src/serialize/txt/rdata_parsers/caa.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
//! mail exchange, email, record
1818
19-
use tracing::warn;
19+
use tracing::debug;
2020

2121
use crate::proto::rr::rdata::caa;
2222
use crate::proto::rr::rdata::caa::{Property, Value};
@@ -60,7 +60,7 @@ pub(crate) fn parse<'i, I: Iterator<Item = &'i str>>(mut tokens: I) -> ParseResu
6060
let issuer_critical = {
6161
let flags = flags_str.parse::<u8>()?;
6262
if flags & 0b0111_1111 != 0 {
63-
warn!("unexpected flag values in caa (0 or 128): {}", flags);
63+
debug!("unexpected flag values in caa (0 or 128): {}", flags);
6464
}
6565

6666
flags & 0b1000_0000 != 0
@@ -71,7 +71,7 @@ pub(crate) fn parse<'i, I: Iterator<Item = &'i str>>(mut tokens: I) -> ParseResu
7171
// unnecessary clone
7272
let tag = Property::from(tag_str.to_string());
7373
if tag.is_unknown() {
74-
warn!("unknown tag found for caa: {:?}", tag);
74+
debug!("unknown tag found for caa: {:?}", tag);
7575
}
7676
tag
7777
};

crates/proto/src/https/https_client_stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use rustls::ClientConfig;
2626
use tokio_rustls::{
2727
client::TlsStream as TokioTlsClientStream, Connect as TokioTlsConnect, TlsConnector,
2828
};
29-
use tracing::{debug, warn};
29+
use tracing::debug;
3030

3131
use crate::error::ProtoError;
3232
use crate::iocompat::AsyncIoStdAsTokio;
@@ -476,7 +476,7 @@ where
476476
debug!("h2 connection established to: {}", name_server);
477477
tokio::spawn(
478478
connection
479-
.map_err(|e| warn!("h2 connection failed: {}", e))
479+
.map_err(|e| debug!("h2 connection failed: {}", e))
480480
.map(|_: Result<(), ()>| ()),
481481
);
482482

crates/proto/src/op/message.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
use std::{fmt, iter, mem, ops::Deref, sync::Arc};
1111

12-
use tracing::{debug, warn};
12+
use tracing::debug;
1313

1414
use crate::{
1515
error::*,
@@ -972,7 +972,7 @@ where
972972
additional_count.0 += count.0;
973973
additional_count.1 |= count.1;
974974
} else if header.response_code().high() > 0 {
975-
warn!(
975+
debug!(
976976
"response code: {} for request: {} requires EDNS but none available",
977977
header.response_code(),
978978
header.id()

crates/proto/src/rr/dnssec/rdata/dnskey.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl DNSKEY {
249249
.emit(&mut encoder)
250250
.and_then(|_| emit(&mut encoder, self))
251251
{
252-
tracing::warn!("error serializing dnskey: {}", e);
252+
tracing::debug!("error serializing dnskey: {}", e);
253253
return Err(format!("error serializing dnskey: {}", e).into());
254254
}
255255
}

crates/proto/src/rr/dnssec/supported_algorithm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::fmt::{Display, Formatter};
2323
#[cfg(feature = "serde-config")]
2424
use serde::{Deserialize, Serialize};
2525

26-
use tracing::warn;
26+
use tracing::debug;
2727

2828
use crate::error::*;
2929
use crate::rr::dnssec::Algorithm;
@@ -149,7 +149,7 @@ impl<'a> From<&'a [u8]> for SupportedAlgorithms {
149149

150150
for a in values.iter().map(|i| Algorithm::from_u8(*i)) {
151151
match a {
152-
Algorithm::Unknown(v) => warn!("unrecognized algorithm: {}", v),
152+
Algorithm::Unknown(v) => debug!("unrecognized algorithm: {}", v),
153153
a => supported.set(a),
154154
}
155155
}

crates/proto/src/rr/rdata/opt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::collections::HashMap;
2222
#[cfg(feature = "serde-config")]
2323
use serde::{Deserialize, Serialize};
2424

25-
use tracing::warn;
25+
use tracing::debug;
2626

2727
use crate::error::*;
2828
use crate::serialize::binary::*;
@@ -285,7 +285,7 @@ pub fn read(decoder: &mut BinDecoder<'_>, rdata_length: Restrict<u16>) -> ProtoR
285285
if state != OptReadState::ReadCode {
286286
// there was some problem parsing the data for the options, ignoring them
287287
// TODO: should we ignore all of the EDNS data in this case?
288-
warn!("incomplete or poorly formatted EDNS options: {:?}", state);
288+
debug!("incomplete or poorly formatted EDNS options: {:?}", state);
289289
options.clear();
290290
}
291291

crates/proto/src/rr/record_data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
1818
use serde::{Deserialize, Serialize};
1919

2020
use enum_as_inner::EnumAsInner;
21-
use tracing::{trace, warn};
21+
use tracing::{debug, trace};
2222

2323
use super::domain::Name;
2424
use super::rdata;
@@ -698,7 +698,7 @@ impl RData {
698698
{
699699
let mut encoder: BinEncoder<'_> = BinEncoder::new(&mut buf);
700700
self.emit(&mut encoder).unwrap_or_else(|_| {
701-
warn!("could not encode RDATA: {:?}", self);
701+
debug!("could not encode RDATA: {:?}", self);
702702
});
703703
}
704704
buf

crates/proto/src/rr/rr_set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::iter::Chain;
88
use std::slice::Iter;
99
use std::vec;
1010

11-
use tracing::{info, warn};
11+
use tracing::{debug, info};
1212

1313
use crate::rr::{DNSClass, Name, RData, Record, RecordType};
1414

@@ -312,7 +312,7 @@ impl RecordSet {
312312
}
313313
}
314314
rdata => {
315-
warn!("wrong rdata: {:?}, expected SOA", rdata);
315+
debug!("wrong rdata: {:?}, expected SOA", rdata);
316316
return false;
317317
}
318318
}

0 commit comments

Comments
 (0)