@@ -20,11 +20,14 @@ func CheckExecutable(ctx context.Context, slogger *slog.Logger, potentialBinary
2020 ctx , span := observability .StartSpan (ctx , "binary_path" , potentialBinary )
2121 defer span .End ()
2222
23- slogger = slogger . With ( "subcomponent" , "CheckExecutable" , "binary_path" , potentialBinary , "args" , fmt .Sprintf ("%+v" , args ) )
23+ argsStr := fmt .Sprintf ("%+v" , args )
2424
2525 if err := checkExecutablePermissions (ctx , potentialBinary ); err != nil {
2626 slogger .Log (ctx , slog .LevelWarn ,
2727 "failed executable permissions check" ,
28+ "subcomponent" , "CheckExecutable" ,
29+ "binary_path" , potentialBinary ,
30+ "args" , argsStr ,
2831 "err" , err ,
2932 )
3033 return fmt .Errorf ("checking executable permissions: %w" , err )
@@ -37,6 +40,9 @@ func CheckExecutable(ctx context.Context, slogger *slog.Logger, potentialBinary
3740 if filepath .Clean (selfPath ) == filepath .Clean (potentialBinary ) {
3841 slogger .Log (ctx , slog .LevelInfo ,
3942 "binary path matches current executable path, no need to exec" ,
43+ "subcomponent" , "CheckExecutable" ,
44+ "binary_path" , potentialBinary ,
45+ "args" , argsStr ,
4046 "self_path" , selfPath ,
4147 )
4248 return nil
@@ -51,6 +57,9 @@ func CheckExecutable(ctx context.Context, slogger *slog.Logger, potentialBinary
5157 if execErr == nil {
5258 slogger .Log (ctx , slog .LevelInfo ,
5359 "successfully checked executable" ,
60+ "subcomponent" , "CheckExecutable" ,
61+ "binary_path" , potentialBinary ,
62+ "args" , argsStr ,
5463 )
5564 return nil
5665 }
@@ -63,6 +72,9 @@ func CheckExecutable(ctx context.Context, slogger *slog.Logger, potentialBinary
6372 // Non-retryable error
6473 slogger .Log (ctx , slog .LevelWarn ,
6574 "executable check returned error" ,
75+ "subcomponent" , "CheckExecutable" ,
76+ "binary_path" , potentialBinary ,
77+ "args" , argsStr ,
6678 "exec_err" , execErr ,
6779 "command_output" , string (out ),
6880 )
@@ -71,6 +83,9 @@ func CheckExecutable(ctx context.Context, slogger *slog.Logger, potentialBinary
7183
7284 slogger .Log (ctx , slog .LevelWarn ,
7385 "received ETXTBSY multiple times when running executable check" ,
86+ "subcomponent" , "CheckExecutable" ,
87+ "binary_path" , potentialBinary ,
88+ "args" , argsStr ,
7489 )
7590
7691 return fmt .Errorf ("could not exec %s despite retries due to text file busy" , potentialBinary )
0 commit comments