Skip to the content.

🏠 Gofer Engine > Channel Workflows > Logging

Logging

The logger is currently set up to log with console.log. In a future release, you will be able to hook into Gofer Engine and define your custom logger.

Logger is part of the Context. This allows you to use the logger from within any flow that includes the context such as a filter or transformer.

There are 4 log levels:

The logger is fairly simple to use as seen in this example of a filter step:

// example.som
gofer
  .listen('tcp', 'localhost', 5501)
  .filter((msg, context) => {
    const isFemale = msg.get('PID-8')==='F'
    const { messageId, logger } = context
    if (!isFemale) {
      context.logger(`Msg ${messageId} was not a Female`, 'info')
    }
    return isFemale
  })
  .run()