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

Decrease default errors verbosity #132

Merged

Conversation

Bobronium
Copy link
Contributor

@Bobronium Bobronium commented May 8, 2022

This shifts error verbosity to reduce terminal output pollution

Replaces

python-poetry/poetry#2915
python-poetry/poetry#5559

Resolves:

python-poetry/poetry#2854
python-poetry/poetry#3273
python-poetry/poetry#4014
python-poetry/poetry#5229

Current behaviour

  • default: render error with source reference and solution if present
  • CleoSimpleException: render it with just a message, never display solution
  • io.is_verbose(): default + full stack trace

New behaviour

  • default / CleoSimpleException: render error with just a message + solution if present
  • io.is_verbose(): render error with source reference + solution if present
  • io.is_very_verbose(): io.is_verbose() + full stack trace

In other words

  • simple is enabled by default (whilst supporting solutions)
  • verbose is now previous default (compact source reference)
  • very_verbose is now previous verbose

Showcase

image

@Bobronium
Copy link
Contributor Author

@sdispater, please take a look when you'll have time

@sdispater
Copy link
Member

What's the reasoning behind making the stack trace available only for the very verbose verbosity onwards? I would prefer to keep it at the verbose level.

Otherwise the rest looks good.

@Bobronium
Copy link
Contributor Author

@sdispater, if it would be displayed on verbose, then there wouldn't be an option to show compact source reference anymore.

In current implementation, verbosity will gradually increase:

  1. default — just message
  2. verbose — source reference
  3. very_verbose — full stack trace

If full stack trace is shown on verbose, we then loose option to just show source reference:

  1. default — just message
  2. verbose — full stack trace
  3. very_verbose — full stack trace

I wouldn't want to loose such feature since it's sufficient in most cases, and when more needed — one can ask for more by -vv.

@sdispater
Copy link
Member

Thanks for the explanation, I somehow missed this subtlety.

Works for me then 👍

@Bobronium
Copy link
Contributor Author

Seems like failed with pallets/click#2225,
Proposed a fix in #137

@Bobronium
Copy link
Contributor Author

Is there anything preventing merging/releasing this?

@Secrus
Copy link
Member

Secrus commented May 29, 2022

@Bobronium could you please fix pre-commit issues and rebase with current master?

@branchvincent
Copy link
Member

@Bobronium do you mind rebasing this? We'll be releasing a new version soon and it would be great to include this

@Bobronium
Copy link
Contributor Author

@branchvincent, no, I don't mind. I might get to this today or tomorrow.

Remove Inspector import
Reformat cleo/ui/exception_trace.py with black
@Bobronium
Copy link
Contributor Author

@Secrus, @branchvincent, done!

Copy link
Member

@branchvincent branchvincent left a comment

Choose a reason for hiding this comment

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

thanks @Bobronium!

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.

None yet

4 participants