Skip to content

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

@flinn

Description

@flinn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions