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

Test: Allow CliTool to write out stacktraces #7222

Merged
merged 1 commit into from Aug 12, 2014

Conversation

spinscale
Copy link
Contributor

In order to have the possibility of debugging on the command line, the user
now can either set the ES_CLI_DEBUG environment variable or at es.cli.debug system
property which results in stack traces being written to stdout.

@@ -108,6 +113,14 @@ public void printError(String msg, Object... args) {
println(Verbosity.SILENT, "ERROR: " + msg, args);
}

public void printError(Throwable t) {
printError("%s", t.getMessage());
boolean isDebugEnabled = "true".equals(System.getProperty(DEBUG_SYSTEM_PROPERTY, System.getenv(DEBUG_ENV_VAR)));
Copy link
Contributor

Choose a reason for hiding this comment

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

why not pull this out to a static var called debugMode?

Copy link
Contributor

Choose a reason for hiding this comment

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

otherwise, if you want it for testing, it can be done once in the ctor

@uboness
Copy link
Contributor

uboness commented Aug 11, 2014

left a few comments, otherwise LGTM

@jpountz jpountz removed the review label Aug 12, 2014
@spinscale
Copy link
Contributor Author

@uboness incorporated all of your review comments, were all good and valid. thx!

@uboness
Copy link
Contributor

uboness commented Aug 12, 2014

LGTM

In order to have the possibility of debugging on the command line, the user
now can either set the es.cli.debug system property
which results in stack traces being written to to the terminal.

Closes elastic#7222
@spinscale spinscale merged commit e689a0a into elastic:master Aug 12, 2014
spinscale added a commit that referenced this pull request Aug 12, 2014
In order to have the possibility of debugging on the command line, the user
now can either set the es.cli.debug system property
which results in stack traces being written to to the terminal.

Closes #7222
spinscale added a commit that referenced this pull request Sep 8, 2014
In order to have the possibility of debugging on the command line, the user
now can either set the es.cli.debug system property
which results in stack traces being written to to the terminal.

Closes #7222
@clintongormley clintongormley added >test Issues or PRs that are addressing/adding tests and removed >enhancement labels Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test Issues or PRs that are addressing/adding tests v1.4.0.Beta1 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants