From 4b4c8dae637c8a72f4be09b06a9af4cacab4f851 Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:47:52 -0500 Subject: [PATCH] Convert lib/windowsexec to use slog (#50307) --- lib/windowsexec/syscall_windows.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/windowsexec/syscall_windows.go b/lib/windowsexec/syscall_windows.go index 4f8955ff731a6..769eeed78a1ce 100644 --- a/lib/windowsexec/syscall_windows.go +++ b/lib/windowsexec/syscall_windows.go @@ -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" ) @@ -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 {