Debug with log entries

If something goes wrong in the hook, log entries can help you debug it.

Use console.log() and console.error() to add log and error entries, respectively.


Here is a hook example with logging:

module.exports = async function (payload, actions) {
  const { data } = await actions.http.get('https://cloudhooks.dev');

  if (data.length > 50*1024) {
    console.log('Downloaded data is more than 50kb!');
  }
}

This is the output of the test run: