[MGNLGROOVY-48] Less obtrusive toString() implementation Created: 19/Sep/11  Updated: 15/Nov/13  Resolved: 11/Oct/13

Status: Closed
Project: Magnolia Groovy Module
Component/s: integration
Affects Version/s: None
Fix Version/s: 2.2

Type: Improvement Priority: Neutral
Reporter: Magnolia International Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Epic Link: Module UI migration
Sprint: 5.2-beta1

 Description   

The current re-implementation of the toString() method outputs a node's properties and subnodes. While this can be useful in the console, it can get pretty verbose and unreadable in logs, when using components whose log statements have been written naively relying on the default toString() implementation of nodes/content. (ie log.info("lalala {} lala", someNode"))

It'd be neat if there was a way to only apply this toString implementation in the context of the console.

I'd argue however that removing altogether might also be an option; the code doing this output could be moved to a class such as the existing DumpUtil which provide similar functionality. (and as such, in a console, you'd do DumpUtil.dump(myNode) instead of myNode. (and/or we could add support for keywords like cat or ls...)


Generated at Mon Feb 12 05:55:03 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.