Is there any standard, or simply just a best practice for a style?
No. The "best" output for a toString()
method is determined by what you want to use it for. Is it for serializing the object state in a form that allows it to be deserialized? Is it for creating debug messages? Is it for rendering the object for display to end-users?
If you want to develop an in-house style for your debug/logging toString()
methods, that's fine. But unless there was a requirement for this, I wouldn't bother. IMO, it is effort that could better be spent elsewhere.