From cd2c5302481769f58688d6591ad98fc0300cf019 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Sun, 8 Sep 2024 11:27:13 -0400 Subject: [PATCH] chore: move start logging for dns listener Signed-off-by: Chris Gianelloni --- cmd/cdnsd/main.go | 7 ------- internal/dns/dns.go | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/cdnsd/main.go b/cmd/cdnsd/main.go index caec5ef..a7a8705 100644 --- a/cmd/cdnsd/main.go +++ b/cmd/cdnsd/main.go @@ -136,13 +136,6 @@ func main() { } // Start DNS listener - slog.Info( - fmt.Sprintf( - "starting DNS listener on %s:%d", - cfg.Dns.ListenAddress, - cfg.Dns.ListenPort, - ), - ) if err := dns.Start(); err != nil { slog.Error( fmt.Sprintf("failed to start DNS listener: %s", err), diff --git a/internal/dns/dns.go b/internal/dns/dns.go index 9ec18fc..adc814b 100644 --- a/internal/dns/dns.go +++ b/internal/dns/dns.go @@ -36,6 +36,12 @@ func Start() error { cfg.Dns.ListenAddress, cfg.Dns.ListenPort, ) + slog.Info( + fmt.Sprintf( + "starting DNS listener on %s", + listenAddr, + ), + ) // Setup handler dns.HandleFunc(".", handleQuery) // UDP listener