Skip to content

Commit

Permalink
Merge pull request #102 from telekom-mms/feature/add-info-logging-to-…
Browse files Browse the repository at this point in the history
…daemon

Add info logging to Daemon
  • Loading branch information
hwipl authored Jun 7, 2024
2 parents 3942521 + 8aec00b commit 6c32ae9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/daemon/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ func run(args []string) error {
var err error
select {
case <-c:
log.Info("Daemon got interrupt signal")
case err = <-daemon.Errors():
}

Expand Down
5 changes: 4 additions & 1 deletion internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ func (d *Daemon) handleSleepMonEvent(sleep bool) {

// disconnect vpn on resume
if !sleep && d.status.OCRunning.Running() {
log.Info("Daemon resuming after sleep, disconnecting")
d.disconnectVPN()
}
}
Expand All @@ -476,7 +477,7 @@ func readXMLProfile(xmlProfile string) *xmlprofile.Profile {

// handleProfileUpdate handles a xml profile update.
func (d *Daemon) handleProfileUpdate() error {
log.Debug("Daemon handling XML profile update")
log.Info("Daemon got XML profile update")
d.profile = readXMLProfile(d.config.OpenConnect.XMLProfile)
d.stopTND()
d.stopTrafPol()
Expand Down Expand Up @@ -673,6 +674,7 @@ func (d *Daemon) start() {
defer d.server.Shutdown()

// run main loop
log.Info("Daemon started")
for {
select {
case req := <-d.server.Requests():
Expand Down Expand Up @@ -702,6 +704,7 @@ func (d *Daemon) start() {
}

case <-d.done:
log.Info("Daemon stopping")
return
}
}
Expand Down

0 comments on commit 6c32ae9

Please sign in to comment.