Skip to content
Matthieu Lemoine edited this page Oct 7, 2018 · 2 revisions

Immersive provides a convenient logger to each command.

This logger supports the following log levels:

  • error: log prefixed with red error label
  • warn: log prefixed with yellow warn label
  • info: log prefixed with green info label
  • debug: log prefixed with blue debug label
  • log: log without formatting
export const action = ({ logger }) => {
  logger.error('Something went wrong');
  logger.warn('Something is not quite right');
  logger.info('Something has been done');
  logger.debug('Something has been done but you should only see me during debugging');
  logger.log('Something');
}

Table

The logger also provides table method to display tabular data.

logger.table({ rows, name: 'Table name' })
Clone this wiki locally