Improve interface state log message

This commit is contained in:
Daniel Lorch 2025-05-14 21:48:29 +02:00
parent efde7dcc3d
commit a467793f39
1 changed files with 3 additions and 2 deletions

View File

@ -174,11 +174,12 @@ func (s *NetworkInterfaceState) update() (DhcpTargetState, error) {
} }
if changed { if changed {
scopedLogger := s.l.With().Str("iface", s.interfaceName).Logger()
if interfaceGoingUp { if interfaceGoingUp {
s.l.Info().Msg("interface state transitioned to up") scopedLogger.Info().Msg("interface state transitioned to up")
dhcpTargetState = DhcpTargetStateRenew dhcpTargetState = DhcpTargetStateRenew
} else if interfaceGoingDown { } else if interfaceGoingDown {
s.l.Info().Msg("interface state transitioned to down") scopedLogger.Info().Msg("interface state transitioned to down")
} }
} }