From 5d5a4a2e65daf32804a015c555d1956bccade661 Mon Sep 17 00:00:00 2001 From: Brian Engert Date: Mon, 10 Jun 2024 11:29:02 -0500 Subject: [PATCH] feat: added some more logging and include the timestamp. --- src/cli.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 326ab83..27ed381 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -24,6 +24,9 @@ type ScriptResult = { } } +const log = (message: String) => { + console.log(new Date().toLocaleTimeString(), message); +} const mkdir = async (path: string): Promise => { try { @@ -58,7 +61,7 @@ for (const file of files) { const layout = client.layout('SaXMLDeliveryExecutionContext'); - console.log('calling FM script'); + log('calling FM script'); const executeScriptResult = await layout.executeScript('RunSaXMLDelivery'); @@ -87,7 +90,7 @@ for (const file of files) { process.exit(20); } - console.log('Starting download of container field'); + log('Starting download of container field'); const containerResponse = await client.requestContainer(containerUrl); @@ -96,10 +99,13 @@ for (const file of files) { transcode(containerResponse.buffer, 'utf-16le', 'utf8') ); + log('finished downloading container field'); + const clearXml : Partial = {}; clearXml[field] = ''; await layout.update(Number(records.data[0].recordId), clearXml); await client.clearToken(); + log('finished'); }