mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-11 18:17:40 +00:00
additional debug logging, use mapper pointer
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:

committed by
Kristoffer Dalby

parent
eff529f2c5
commit
e0ba325b3b
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/juanfont/headscale/hscontrol/types"
|
||||
"github.com/juanfont/headscale/hscontrol/util"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
type Notifier struct {
|
||||
@@ -25,6 +26,11 @@ func (n *Notifier) AddNode(machineKey string, c chan<- types.StateUpdate) {
|
||||
}
|
||||
|
||||
n.nodes[machineKey] = c
|
||||
|
||||
log.Trace().
|
||||
Str("machine_key", machineKey).
|
||||
Int("open_chans", len(n.nodes)).
|
||||
Msg("Added new channel")
|
||||
}
|
||||
|
||||
func (n *Notifier) RemoveNode(machineKey string) {
|
||||
@@ -36,6 +42,11 @@ func (n *Notifier) RemoveNode(machineKey string) {
|
||||
}
|
||||
|
||||
delete(n.nodes, machineKey)
|
||||
|
||||
log.Trace().
|
||||
Str("machine_key", machineKey).
|
||||
Int("open_chans", len(n.nodes)).
|
||||
Msg("Removed channel")
|
||||
}
|
||||
|
||||
func (n *Notifier) NotifyAll(update types.StateUpdate) {
|
||||
|
Reference in New Issue
Block a user