Debugging/printing in a Hubot script

前端 未结 4 2065
春和景丽
春和景丽 2021-02-07 15:12

I\'m trying to debug an existing Hubot script and in the future write my own, and I need an easy way to debug it or at least print values somewhere (but not to the channel). How

4条回答
  •  长情又很酷
    2021-02-07 16:11

    Found this (coffeescript) snippet somewhere which logs all errors, quite helpful to add to bots in development.

    robot.error (err, res) -> robot.logger.error "#{err}\n#{err.stack}" if res? res.reply "#{err}\n#{err.stack}"

提交回复
热议问题