Skip to content

Commit d2220c1

Browse files
committed
adding more debug info
1 parent 8981f0d commit d2220c1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Service/system-service_windows.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ func (thisRef *WindowsService) Stop() error {
229229
thisRef.command.OnStopDelegate()
230230
}
231231

232+
logging.Instance().LogDebugWithFields(loggingC.Fields{
233+
"method": helpersReflect.GetThisFuncName(),
234+
"message": fmt.Sprintf("%s: OnStopDelegate called: %s", logTag, thisRef.command.Name),
235+
})
236+
232237
err := thisRef.control(svc.Stop, svc.Stopped)
233238
if err != nil {
234239
e := err.Error()
@@ -238,6 +243,11 @@ func (thisRef *WindowsService) Stop() error {
238243
return nil
239244
}
240245

246+
logging.Instance().LogErrorWithFields(loggingC.Fields{
247+
"method": helpersReflect.GetThisFuncName(),
248+
"message": fmt.Sprintf("%s: error %s, details: %s", logTag, thisRef.command.Name, err.Error()),
249+
})
250+
241251
return err
242252
}
243253

@@ -271,6 +281,11 @@ func (thisRef *WindowsService) Stop() error {
271281
}
272282
}
273283

284+
logging.Instance().LogDebugWithFields(loggingC.Fields{
285+
"method": helpersReflect.GetThisFuncName(),
286+
"message": fmt.Sprintf("%s: stopped: %s", logTag, thisRef.command.Name),
287+
})
288+
274289
return nil
275290
}
276291

0 commit comments

Comments
 (0)