From 0bb2fabc6c6b6120bb29da1bea484bd9fe3b145a Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Thu, 5 Aug 2021 18:16:21 +0100 Subject: [PATCH] Convert missing from api.go --- api.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/api.go b/api.go index af8a6dcd..960217dd 100644 --- a/api.go +++ b/api.go @@ -92,7 +92,10 @@ func (h *Headscale) RegistrationHandler(c *gin.Context) { NodeKey: wgkey.Key(req.NodeKey).HexString(), } if err := h.db.Create(&m).Error; err != nil { - log.Printf("Could not create row: %s", err) + log.Error(). + Str("Handler", "Registration"). + Err(err). + Msg("Could not create row") return } } @@ -335,7 +338,10 @@ func (h *Headscale) PollNetMapHandler(c *gin.Context) { Msg("Sending initial map") pollData <- *data - log.Printf("[PollMap] (%s) Notifying peers", m.Name) + log.Info(). + Str("Handler", "PollNetMap"). + Str("Machine", m.Name). + Msg("Notifying peers") peers, _ := h.getPeers(m) h.pollMu.Lock() for _, p := range *peers {