diff --git a/service_windows.go b/service_windows.go index c6ee3a6c..155d3560 100644 --- a/service_windows.go +++ b/service_windows.go @@ -131,11 +131,11 @@ func (l WindowsLogger) NInfof(eventID uint32, format string, a ...interface{}) e var interactive = false func init() { - var err error - interactive, err = svc.IsAnInteractiveSession() + isService, err := svc.IsWindowsService() if err != nil { panic(err) } + interactive = !isService } func (ws *windowsService) String() string {