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

toString() implementation for logging #88

Closed
dmzaytsev opened this issue Mar 28, 2015 · 4 comments
Closed

toString() implementation for logging #88

dmzaytsev opened this issue Mar 28, 2015 · 4 comments

Comments

@dmzaytsev
Copy link
Contributor

We need to implement toString() for all classes which will be loggable via org.takes.facets.slf4j(#28). Moreover for classes which used as parameters.
Maybe could be use @lombok.ToString?

@yegor256
Copy link
Owner

@dmzaytsev please reformat the ticket so that it starts sound like a bug, see http://www.yegor256.com/2014/11/24/principles-of-bug-tracking.html#5.-report-when-it-is-broken

@dmzaytsev
Copy link
Contributor Author

I expect that this code

Take take  = new TkText("test");
System.out.println(String.format("%s act() return %s", take, take()));

prints something like this
TkText(body=test) act () return RsText(body=test)
But it prints
[org.takes.tk.TkText@61f8bf5a] #act() return [org.takes.rs.RsText@7b49d002]

I guess the lack toString() is the reason.

This applies to all classes which will be loggable via org.takes.facets.slf4j(#28).

@yegor256
Copy link
Owner

@dmzaytsev this description of the problem is better than you original ticket description. But still, you should say what you need, not what we should do in order to satisfy your needs. You should say what is broken. In this particular ticket, I would say something like: "I expect each class to be able to convert itself to a loggable string, but they don't have this feature". It's up to "us", whether to give you toString() or some other mechanism. See my point?

@dmzaytsev
Copy link
Contributor Author

I'll create another ticket

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

No branches or pull requests

2 participants