Skip to content

feat: add env debug output to oscommand#18

Open
matt-FFFFFF wants to merge 1 commit into
mainfrom
feat/minorDebugImprov
Open

feat: add env debug output to oscommand#18
matt-FFFFFF wants to merge 1 commit into
mainfrom
feat/minorDebugImprov

Conversation

@matt-FFFFFF
Copy link
Copy Markdown
Owner

@matt-FFFFFF matt-FFFFFF commented Jun 25, 2025

Adds environment to the debug output

Copilot AI review requested due to automatic review settings June 25, 2025 08:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends the debug logging within the OSCommand’s Run method to include environment variables, which can help with enhanced troubleshooting.

  • Added "env" parameter to the debug log for command details.
  • Updated the debug output in internal/runbatch/osCommand.go to include c.Env.

With("label", fullLabel)

logger.Debug("command info", "path", c.Path, "cwd", c.Cwd, "args", c.Args)
logger.Debug("command info", "path", c.Path, "cwd", c.Cwd, "args", c.Args, "env", c.Env)
Copy link

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider filtering or redacting sensitive environment variable values from the debug log to avoid inadvertently exposing sensitive data.

Suggested change
logger.Debug("command info", "path", c.Path, "cwd", c.Cwd, "args", c.Args, "env", c.Env)
sanitizedEnv := sanitizeEnv(c.Env)
logger.Debug("command info", "path", c.Path, "cwd", c.Cwd, "args", c.Args, "env", sanitizedEnv)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants