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

Turn on debug mode by default #221

Merged
merged 1 commit into from
Jan 31, 2019
Merged

Turn on debug mode by default #221

merged 1 commit into from
Jan 31, 2019

Conversation

mtreinish
Copy link
Owner

By default cliff suppresses stack traces on unhandled exceptions in order
to keep the output cleaner for users. But in practice this has caused more
confusion for stestr users since often the error messages aren't really
descriptive enough to indicate what's going wrong (or that it's even a
bug in stestr). This is often because exception messages are written
assuming the context of the stack trace for debugging, not to be user
facing messages. Cliff offers the --debug flag to enable printing the
full stack traces. This commit turns that flag on by default when stestr
initializes the cliff App object to ensure that it always prints the
full stack trace on an unhandled exception.

Fixes #220

By default cliff suppresses stack traces on unhandled exceptions in order
to keep the output cleaner for users. But in practice this has caused more
confusion for stestr users since often the error messages aren't really
descriptive enough to indicate what's going wrong (or that it's even a
bug in stestr). This is often because exception messages are written
assuming the context of the stack trace for debugging, not to be user
facing messages. Cliff offers the --debug flag to enable printing the
full stack traces. This commit turns that flag on by default when stestr
initializes the cliff App object to ensure that it always prints the
full stack trace on an unhandled exception.

Fixes #220
@mtreinish mtreinish requested a review from masayukig January 30, 2019 16:13
@mtreinish mtreinish changed the title Turn on debug loggin by default Turn on debug mode by default Jan 30, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 65.314% when pulling 300f0b2 on debug-by-default into 18d6150 on master.

@masayukig
Copy link
Collaborator

masayukig commented Jan 31, 2019

LGTM. This can provide much more useful information to users. But I also think we should care #219 case. Maybe, another patch is needed?

When I saw this PR at the first time, I felt this is not good behavior, we should suppress stack traces to users as possible. But after I read #219 and #220 , it's OK as a kind of workaround.

So, I think an ideal behavior is that we catch all errors (in cliff or stestr), and then, print more useful message like @aspiers said in #220 (comment) .

@masayukig masayukig merged commit 2b3a38a into master Jan 31, 2019
@mtreinish mtreinish deleted the debug-by-default branch February 26, 2019 23:10
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.

3 participants