Ability to Choose Format Used for Logging via CLI Flag

Open
#144 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
cli

Research direction

Start at the git-xargs CLI command and trace how command execution logs are currently produced. Clarify whether the work covers only --log-format or also --log-file and --log-file-isolation, then define completion around the requested text/JSON output and repository-specific log files.

Written by the indexing model from the issue text.

Description

enhancement

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
Dominant language
Go
Stars
1.1k
Forks
75
Avg merge
22h 5m
Merged PRs (30d)
4

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from gruntwork-io/git-xargs

All issues in gruntwork-io/git-xargs

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.