Skip to content

Tweak more log levels #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/routedns/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ arguments.
SilenceUsage: true,
}

cmd.Flags().Uint32VarP(&opt.logLevel, "log-level", "l", 4, "log level; 0=None .. 6=Trace")
cmd.Flags().Uint32VarP(&opt.logLevel, "log-level", "l", 4, "log level; 1=None,2=Error,3=Warn,4=Info,5=Debug,6=Trace")
cmd.Flags().BoolVarP(&opt.version, "version", "v", false, "Prints code version string")

if err := cmd.Execute(); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions doqclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (d *DoQClient) Resolve(q *dns.Msg, ci ClientInfo) (*dns.Msg, error) {
if edns0 != nil {
for _, opt := range edns0.Option {
if opt.Option() == dns.EDNS0TCPKEEPALIVE {
d.log.Error("received edns-tcp-keepalive from doq server, aborting")
d.log.Warn("received edns-tcp-keepalive from doq server, aborting")
d.metrics.err.Add("keepalive", 1)
return nil, errors.New("received edns-tcp-keepalive over doq server")
}
Expand All @@ -217,7 +217,7 @@ func (s *quicConnection) getStream(endpoint string, log *slog.Logger) (quic.Stre
var err error
s.EarlyConnection, s.udpConn, err = quicDial(context.TODO(), endpoint, s.lAddr, s.tlsConfig, s.config, s.Use0RTT)
if err != nil {
log.Error("failed to open connection",
log.Warn("failed to open connection",
"hostname", s.hostname,
"error", err,
)
Expand All @@ -233,12 +233,12 @@ func (s *quicConnection) getStream(endpoint string, log *slog.Logger) (quic.Stre
"error", err,
)
if err = quicRestart(s); err != nil {
log.Error("failed to open connection", "hostname", s.hostname, "error", err)
log.Warn("failed to open connection", "hostname", s.hostname, "error", err)
return nil, err
}
stream, err = s.EarlyConnection.OpenStream()
if err != nil {
log.Error("failed to open stream",
log.Warn("failed to open stream",
"error", err,
)
}
Expand Down
4 changes: 2 additions & 2 deletions pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (c *Pipeline) start() {
conn, err := c.client.Dial(c.addr)
if err != nil {
c.metrics.err.Add("open", 1)
log.Error("failed to open connection", "error", err)
log.Warn("failed to open connection", "error", err)
req.markDone(nil, err)
continue
}
Expand Down Expand Up @@ -154,7 +154,7 @@ func (c *Pipeline) start() {
// got a bad packet (like a truncated one for example).
if a == nil {
c.metrics.err.Add("read", 1)
log.Error("read failed", "error", err)
log.Warn("read failed", "error", err)
close(done) // tell the writer to not use this connection anymore
wg.Done()
return
Expand Down
Loading