Skip to content

Change System.err.println and exception.printStackTrace by Logging in ForgivingExceptionHandler.java #113

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

Closed
PatrickSauts opened this issue Dec 8, 2015 · 6 comments

Comments

@PatrickSauts
Copy link
Contributor

Message in the class ForgivingExceptionHandler.java like:
System.err.println("Caught an exception during connection recovery!");
exception.printStackTrace(System.err);

should go throw the logger.
The user should be able to ignore those messages if he choose to using the logger configuration file.

@michaelklishin
Copy link
Contributor

@PatrickSauts have you considered submitting a pull request?

@PatrickSauts
Copy link
Contributor Author

I can do that yes. in a few hours.

@PatrickSauts
Copy link
Contributor Author

I have a question though @michaelklishin.
No Logger is define in any part of the code but Tracer.java which actually does sysout.

Can I add a dependency on SLF4J ? Or do you have anything else in mind ?

@michaelklishin
Copy link
Contributor

@PatrickSauts no, you can't. I've misread the title. We will file a separate issue about what should be used for logging, as we are very careful about introducing dependencies.

@vladhid
Copy link

vladhid commented Aug 9, 2016

Maybe you could at least add some method like

void produceErrorMessage(String message, Throwable cause) {
    System.err.println(message);
    cause.printStackTrace();
}

to ForgivingExceptionHandler so there would be one-point entry for choosing the way to write messages to logs?

@michaelklishin
Copy link
Contributor

@vladhid see #114. We will add a logging library dependency.

stream-iori pushed a commit to stream-iori/rabbitmq-java-client that referenced this issue Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants