Skip to content

Conversation

slayer
Copy link

@slayer slayer commented Aug 10, 2018

Currently objects displayed as [object Object]

for example, for event {message: "blabla", meta: {ip: "1.2.3.4", user_id: 123}} and format "{{message}} {{meta}}"
Result will be "blabla [object Object]"

This PR adds helper to display objects as JSON:
"{{message}} {{json meta}}"
Result will be "blabla {ip: "1.2.3.4", user_id: 123}"

@sivasamyk
Copy link
Owner

Thanks for the PR! Can't you directly map the json fields in handlebar like {{{meta.ip}}}? Are the fields in meta dynamic? If so, won't it be useful if we prettify the json using JSON.stringify(context, null, 2);?

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.

2 participants