@ns8/ns8-shopify-switches
Advanced tools
Comparing version 1.0.180 to 1.0.182
@@ -34,3 +34,3 @@ "use strict"; | ||
} | ||
loggingMethod(safeLabel, output, safeContext); | ||
loggingMethod(`${safeLabel}\n`, this.formatObjectForOutput((safeOutput)), this.formatObjectForOutput(safeContext)); | ||
Logger.logToHoneycomb(safeOutput, safeContext, label ? safeLabel.trim() : undefined); | ||
@@ -51,3 +51,3 @@ } | ||
const message = 'Unable to initialize Honeycomb Logger. Config Details: '; | ||
console.error(message, Logger.getHoneycombConfigDetails(disabled), err); | ||
console.error(`${message}\n`, `${Logger.getHoneycombConfigDetails(disabled)}\n`, err); | ||
return undefined; | ||
@@ -58,2 +58,3 @@ } | ||
if (Logger.honeycombClient == null || Logger.honeycombClient.newEvent == null) { | ||
console.error('Attempted to log and HC Client is null. Env Vars: ', process.env); | ||
return undefined; | ||
@@ -72,2 +73,4 @@ } | ||
dataset: Logger.honeycombDataset, | ||
nodeEnv: process.env.NODE_ENV, | ||
processEnvObj: process.env, | ||
}; | ||
@@ -106,2 +109,10 @@ } | ||
} | ||
static formatObjectForOutput(o) { | ||
try { | ||
return `${JSON.stringify(o, undefined, 2)}\n`; | ||
} | ||
catch (err) { | ||
return ''; | ||
} | ||
} | ||
} | ||
@@ -108,0 +119,0 @@ exports.Logger = Logger; |
@@ -221,3 +221,4 @@ "use strict"; | ||
const { order_id } = switchContext.data; | ||
console.log(switchContext.merchant.domain, order_id); | ||
console.log(switchContext.merchant.domain, order_id, process.env); | ||
Logger_1.Logger.log({ orderId: order_id, currentEnv: process.env }, switchContext, 'processCreateOrderActionContext'); | ||
if (!shouldOrderBeProcessed(switchContext.data)) { | ||
@@ -224,0 +225,0 @@ const message = 'ShopifyCreateOrderActionSwitch:: Order transaction not qualified to create a new order.'; |
{ | ||
"name": "@ns8/ns8-shopify-switches", | ||
"version": "1.0.180", | ||
"version": "1.0.182", | ||
"description": "Custom switches for the shopify integration", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
93553
1143
7