Simplify code api call syslog and option to send log to timeline

Finally got the simple syslog app working from within a script as follows

let sl = await Homey.apps.getApp({ id: ‘nl.nielsdeklerk.log/’ })
sl.apiPut(‘addlog’, {“log”: “Test 1,2,3 4,5,6”})

This has 2 lines of code, I think it could be in one line, but have not figured out how.
Any experienced api experts who know how to do this ?

Now the logging can be read in the syslog app, would it be possible to also log it to the timeline ?
Thanks Kind regards
Theo

Not sure what’s wrong with two lines, but this is a one-liner:

(await Homey.apps.getApp({ id: 'nl.nielsdeklerk.log/' })).apiPut('addlog', { 'log': 'Test 1,2,3 4,5,6'})
1 Like

Thanks works great

Can a @moderators merge this into the Simple (sys) log topic?

Im sure i can add this.
Can you create a ticket for it? Thanks!

Just did, thanks for the effort.