cmd/ctrld: add more logging details

This commit is contained in:
Cuong Manh Le
2023-01-30 21:16:37 +07:00
committed by Cuong Manh Le
parent c82a0e2562
commit 06372031b5
2 changed files with 5 additions and 0 deletions

View File

@@ -536,8 +536,11 @@ func processCDFlags() {
}
if netIface, _ := netInterface(iface); netIface != nil {
logger.Debug().Str("iface", netIface.Name).Msg("Restoring DNS for interface")
if err := resetDNS(netIface); err != nil {
logger.Warn().Err(err).Msg("something went wrong while restoring DNS")
} else {
logger.Debug().Str("iface", netIface.Name).Msg("Restoring DNS successfully")
}
}
tasks := []task{{s.Uninstall, true}}

View File

@@ -30,6 +30,7 @@ type prog struct {
func (p *prog) Start(s service.Service) error {
p.cfg = &cfg
go p.run()
mainLog.Info().Msg("Service started")
return nil
}
@@ -170,6 +171,7 @@ func (p *prog) Stop(s service.Service) error {
return err
}
p.resetDNS()
mainLog.Info().Msg("Service stopped")
return nil
}