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

Truncate strings or values of type variables in toString method that are longer than a defined length #1185

Merged
merged 1 commit into from
Nov 19, 2020

Conversation

arouel
Copy link
Contributor

@arouel arouel commented Jun 3, 2020

The idea is to avoid errors when logging immutable objects which carry a lot of data encoded as strings or type variables. This saves us from writing custom toString methods to avoid excessive logging when a lot of data gets transported with an immutable to be logged.

Please let me know what you think about it.

@arouel arouel force-pushed the truncate-strings-in-toString branch 2 times, most recently from 5c64d0e to 275e5f0 Compare June 3, 2020 13:13
@arouel arouel force-pushed the truncate-strings-in-toString branch from 275e5f0 to 6cb6e80 Compare June 4, 2020 10:59
@arouel arouel changed the title Truncate strings in toString method that are longer than a defined length Truncate strings or values of type variables in toString method that are longer than a defined length Jun 4, 2020
@elucash elucash merged commit 0edc0d3 into immutables:master Nov 19, 2020
@elucash
Copy link
Member

elucash commented Nov 22, 2020

I've played a bit with is, and while making some changes (like avoid generating the util method if not needed etc) there are some test breaks due to error-prone (blows on unused), so I thinking of actually revert to disabling it by default. The main reason is that one of the promises of Immutables was that it's tries to generate quite lean implementation not filled with much of conveniences (and checking for whenever it's needed is not always trivial). I really hope you can use style declaration on some parent package so it will be default for all your types while not changing. I also don't understand that notion of string & type variables, seems like any other objects should be treated the same as type variable substitutions. So I'm changing to handle all objects except for primitives. I hope this works, let me know if not )

elucash added a commit that referenced this pull request Nov 22, 2020
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

2 participants