Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to Choose Format Used for Logging via CLI Flag #144

Open
flinn opened this issue Jan 18, 2024 · 0 comments
Open

Ability to Choose Format Used for Logging via CLI Flag #144

flinn opened this issue Jan 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@flinn
Copy link

flinn commented Jan 18, 2024

Describe Solution You'd Like

Ideally you should be able to pass a flag to the git-xargs CLI command which indicates what format you'd like to use for the logs that are output by the command execution -- For example:

# For JSON Logs...
git-xargs --repo gruntwork-io/cloud-nuke \
   --repo gruntwork-io/terraform-aws-eks \
   --branch-name my-branch \
   --log-format=json
   /usr/local/bin/my-bash-script.sh

Or...

# For Default/Current Behavior...
git-xargs --repo gruntwork-io/cloud-nuke \
   --repo gruntwork-io/terraform-aws-eks \
   --branch-name my-branch \
   --log-format=text
   /usr/local/bin/my-bash-script.sh

Would also be really useful if there was a way to specify other logging-related behaviors as well, for things like:

  • --log-file=my-script-results: Which could take the file system path you wish to output your logs to AND still enable printing stdout/stderr (so you don't need to pipe things to tee to achieve that type of behavior)

  • --log-file-isolation: As a boolean flag that, when enabled & a --log-file is provided, would output the results of the command's execution in an isolated log file PER repo, something like:

my-script-results__summary.log # <- the overall execution summary across all repos
my-script-results__repo-a.log # <-- repo-specific logs for execution of targeted script
my-script-results__repo-b.log
my-script-results__repo-c.log
@flinn flinn added the enhancement New feature or request label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant