You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do you think of allowing for an attachment formatter function?
The reason is that having meta information formatted as an attachment is not necessarily great for other transports (file, console, etc ...).
By having an attachmentFormatter (or transformer whatever name you prefer) function, it would be possible to convert the generic meta information into attachment just for slack.
if(this.attachmentFormatter&&typeofthis.attachmentFormatter==='function'){payload.attachments=this.attachmentFormatter(info)}else{// for compatibility with the way it currently worksletattachments=[]letattachmentKeys=Object.keys(info).filter(key=>!isNaN(parseInt(key)))attachmentKeys.forEach(key=>attachments.push(info[key]))payload.attachments=attachments}
The text was updated successfully, but these errors were encountered:
That sounds like a good idea! This was an issue that I was mulling pretty recently, actually, but it never crossed my mind to use something like a formatter function. I'll integrate that when I get a chance.
What do you think of allowing for an attachment formatter function?
The reason is that having meta information formatted as an attachment is not necessarily great for other transports (file, console, etc ...).
By having an attachmentFormatter (or transformer whatever name you prefer) function, it would be possible to convert the generic meta information into attachment just for slack.
The text was updated successfully, but these errors were encountered: