Logger
Description#
When initializing the SDK, the options.logger
object is an optional object. However, in order to debug effectively when an issue occurs, a logger
object should be provided when initializing the SDK.
The logger
object is expected to have a debug()
and an error()
method. When an appropriate logger is provided, such as console
, Target requests and responses will be logged.
Example#
Node.js
Copied to your clipboard1const TargetClient = require("@adobe/target-nodejs-sdk");2const CONFIG = {3 client: "acmeclient",4 organizationId: "1234567890@AdobeOrg",5 logger: console6};78const targetClient = TargetClient.create(CONFIG);910const request = {11 execute: {12 mboxes: [{13 name: "a1-serverside-ab",14 index: 115 }]16 }17};1819const response = await targetClient.getOffers({ request, targetCookie });
You should see requests and responses being printed in the console.