Skip to content

getLogFormatType

Tells core whether it should compose log body text before calling logging interfaces.

Signature

const { LOG_DETAILS_FORMAT_TYPE } = require('@app-connect/core/lib/constants');

function getLogFormatType(platform, proxyConfig) {
  return LOG_DETAILS_FORMAT_TYPE.PLAIN_TEXT;
}

Return

Return one of the constants from @app-connect/core/lib/constants:

Constant Value Behavior
LOG_DETAILS_FORMAT_TYPE.PLAIN_TEXT text/plain Core builds plain-text composedLogDetails.
LOG_DETAILS_FORMAT_TYPE.HTML text/html Core builds HTML composedLogDetails.
LOG_DETAILS_FORMAT_TYPE.MARKDOWN text/markdown Core builds Markdown composedLogDetails.

If you return another value, such as custom, core does not compose the body and the connector is responsible for building CRM-specific content from the raw inputs.

Proxy mode reads the format from proxyConfig.meta.logFormat; without that value it behaves as custom.

Reference

const { LOG_DETAILS_FORMAT_TYPE } = require('@app-connect/core/lib/constants');
// CHOOSE: plaint text, html, markdown
function getLogFormatType() {
    return LOG_DETAILS_FORMAT_TYPE.PLAIN_TEXT;
}

module.exports = getLogFormatType;