Skip to content

Commit

Permalink
Convert lib/windowsexec to use slog (#50307)
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstimothy authored Dec 17, 2024
1 parent 7b508fe commit 57f4618
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/windowsexec/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ package windowsexec
// without the appropriate package name.

import (
"context"
"log/slog"
"strings"
"time"
"unsafe"

"github.com/gravitational/trace"
log "github.com/sirupsen/logrus"
"golang.org/x/sys/windows"
)

Expand Down Expand Up @@ -111,10 +112,10 @@ func RunAsAndWait(
// Errors from this can be a little vague, and the contents of hInstApp
// can provide additional context. We'll emit a debug log so this is a
// little easier to investigate if a user experience issues with this.
log.WithFields(log.Fields{
"err": err,
"hInstApp": info.hInstApp,
}).Debug("Encountered error calling shellExecuteExW")
slog.DebugContext(context.Background(), "Encountered error calling shellExecuteExW",
"err", err,
"h_inst_app", info.hInstApp,
)
return trace.Wrap(err, "calling shellExecuteExW")
}
if info.hProcess == 0 {
Expand Down

0 comments on commit 57f4618

Please sign in to comment.