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

Replace terminal UI with a more readable logger when src actions exec is run in verbose mode #140

Merged
merged 3 commits into from
Feb 24, 2020

Conversation

mrnugget
Copy link
Contributor

When src action exec previously ran in verbose-mode with the -v flag, it looked like this:

old_verbose

With the changes in this PR it looks like this:

new_logger

Please note: I didn't focus on the details (such as colors, exact words in message, etc). The goal was to untangle the logging from the actionExecutor and the terminal UI, while keeping the behavior in place:

  • In verbose mode, repo-specific log messages are sent to standard error and to a repo-specific log file
  • When not in verbose mode, repo-specific log messages are only sent to repo-specific log file
  • Log files are cleaned up if not -keep-logs flag is given or the repo didn't produce an error

This fixes #119

Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

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

Great, this shortens that waay to bloated function into more readable bits 🌟

diffSupportsNoDereference, err = diffSupportsFlag(ctx, "--no-dereference")
if err != nil {
return err
}
if !diffSupportsNoDereference {
logger.Warnf("Local installation of 'diff' doesn't support '%s' flag. Consider upgrading to GNU diff >=3.7.\n", "--no-dereference")
Copy link
Member

Choose a reason for hiding this comment

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

3.3 I think. For some reason the suggestion button is disabled so I cannot make one 🤦

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You think this is necessary? Newest version is 3.7, I think we should recommend upgrading to that :)

Copy link
Member

Choose a reason for hiding this comment

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

yup definitely makes sense to have people use always the most recent version, I was thinking it might confuse people when they are on some OS that doesn't have 3.7 in their package lists that they cannot use src-cli, but it might be unreasonable to account for that 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's stay with this for now, since I also want to explore some other options (to fix #137) and this might be invalidated soon.

Copy link
Member

Choose a reason for hiding this comment

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

sure :)

@mrnugget mrnugget merged commit 7c48c47 into master Feb 24, 2020
scjohns pushed a commit that referenced this pull request Apr 24, 2023
… is run in verbose mode (#140)

* Change verbose mode of action exec and not show UI

* Introduce actionLogger and print everything through it in verbose mode

* Send generic system messages to actionLogger
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.

a8n: Output shows duplicate lines when verbose flag is given
2 participants