From fef553ed185b279145a132461da862f8f8a98f79 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sun, 26 Nov 2023 16:28:48 +0000 Subject: [PATCH] Tweak logging --- cmd/yggdrasil/main.go | 6 +++--- src/core/link.go | 4 ++-- src/tun/iface.go | 2 +- src/tun/tun_darwin.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/yggdrasil/main.go b/cmd/yggdrasil/main.go index b133ed3..a1c7949 100644 --- a/cmd/yggdrasil/main.go +++ b/cmd/yggdrasil/main.go @@ -216,9 +216,9 @@ func main() { panic(err) } address, subnet := n.core.Address(), n.core.Subnet() - logger.Infof("Your public key is %s", hex.EncodeToString(n.core.PublicKey())) - logger.Infof("Your IPv6 address is %s", address.String()) - logger.Infof("Your IPv6 subnet is %s", subnet.String()) + logger.Printf("Your public key is %s", hex.EncodeToString(n.core.PublicKey())) + logger.Printf("Your IPv6 address is %s", address.String()) + logger.Printf("Your IPv6 subnet is %s", subnet.String()) } // Setup the admin socket. diff --git a/src/core/link.go b/src/core/link.go index 0f445ff..09f815c 100644 --- a/src/core/link.go +++ b/src/core/link.go @@ -432,8 +432,8 @@ func (l *links) listen(u *url.URL, sintf string) (*Listener, error) { } go func() { - l.core.log.Printf("%s listener started on %s", strings.ToUpper(u.Scheme), listener.Addr()) - defer l.core.log.Printf("%s listener stopped on %s", strings.ToUpper(u.Scheme), listener.Addr()) + l.core.log.Infof("%s listener started on %s", strings.ToUpper(u.Scheme), listener.Addr()) + defer l.core.log.Infof("%s listener stopped on %s", strings.ToUpper(u.Scheme), listener.Addr()) for { conn, err := listener.Accept() if err != nil { diff --git a/src/tun/iface.go b/src/tun/iface.go index c98b56d..e06f3a5 100644 --- a/src/tun/iface.go +++ b/src/tun/iface.go @@ -29,7 +29,7 @@ func (tun *TunAdapter) write() { bs := buf[TUN_OFFSET_BYTES:] n, err := tun.rwc.Read(bs) if err != nil { - tun.log.Errorln("Exiting tun writer due to core read error:", err) + tun.log.Errorln("Exiting TUN writer due to core read error:", err) return } if !tun.isEnabled { diff --git a/src/tun/tun_darwin.go b/src/tun/tun_darwin.go index 71f8270..deeb115 100644 --- a/src/tun/tun_darwin.go +++ b/src/tun/tun_darwin.go @@ -111,7 +111,7 @@ func (tun *TunAdapter) setupAddress(addr string) error { var err error if fd, err = unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, 0); err != nil { - tun.log.Printf("Create AF_SYSTEM socket failed: %v.", err) + tun.log.Errorf("Create AF_SYSTEM socket failed: %v.", err) return fmt.Errorf("failed to open AF_SYSTEM: %w", err) }