function nrWinstonFormatter(agent, winston) {
  const config = agent.config
  const metrics = agent.metrics

  return winston.format((logLine) => {
    if (isMetricsEnabled(config)) {
      incrementLoggingLinesMetrics(logLine.level, metrics)
    }

    if (isLocalDecoratingEnabled(config)) {
      logLine.message += agent.getNRLinkingMetadata()
    }

    return logLine
  })
}
This formatter is being used to facilitate
the two application logging use cases: metrics and local log decorating.

Local log decorating appends `NR-LINKING` piped metadata to
the message key in log line. You must configure a log forwarder to get
this data to NR1.

@param {object} agent NR agent
@param {object} winston exported winston package
@returns {object} log line NR-LINKING metadata on message when local log decorating is enabled