Skip to content

Commit

Permalink
Maybe err and eventlogwriter are both nil?
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Apr 29, 2024
1 parent d392019 commit 6fe7147
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions pkg/log/eventlog/writer_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ type Writer struct {
}

func (w *Writer) Close() error {
// TODO RM why does only CI hit this issue
if w == nil {
return nil
}
return windows.DeregisterEventSource(w.handle)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/log/multislogger/syslogger_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ func SystemSlogger() (*MultiSlogger, io.Closer, error) {
if !windows.GetCurrentProcessToken().IsElevated() {
syslogger := defaultSystemSlogger()

syslogger.Log(context.TODO(), slog.LevelDebug,
syslogger.Log(context.TODO(), slog.LevelInfo,
"launcher running on windows without elevated permissions, using default stderr instead of eventlog",
)

return syslogger, io.NopCloser(nil), nil
}

eventLogWriter, err := eventlog.NewWriter(serviceName)
if err != nil {
if err != nil || eventLogWriter == nil {
syslogger := defaultSystemSlogger()

syslogger.Log(context.TODO(), slog.LevelError,
Expand Down

0 comments on commit 6fe7147

Please sign in to comment.