From 69f3b4e987eea524c507d82296652ff4e15eff91 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 24 Feb 2022 12:57:56 -0800 Subject: [PATCH] better debugs --- src/dns/waitfordns.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dns/waitfordns.js b/src/dns/waitfordns.js index 2b593d5bf..582d26e92 100644 --- a/src/dns/waitfordns.js +++ b/src/dns/waitfordns.js @@ -83,15 +83,16 @@ async function waitForDns(hostname, zoneName, type, value, options) { assert.strictEqual(typeof value, 'string'); assert(options && typeof options === 'object'); // { interval: 5000, times: 50000 } - debug(`waitForDns: ${hostname} to be ${value} in zone ${zoneName}`); + debug(`waitForDns: waiting for ${hostname} to be ${value} in zone ${zoneName}`); await promiseRetry(Object.assign({ debug }, options), async function () { const nameservers = await dig.resolve(zoneName, 'NS', { timeout: 5000 }); if (!nameservers) throw new BoxError(BoxError.EXTERNAL_ERROR, 'Unable to get nameservers'); + debug(`waitForDns: nameservers are ${JSON.stringify(nameservers)}`); for (const nameserver of nameservers) { const synced = await isChangeSynced(hostname, type, value, nameserver); - debug('waitForDns: %s %s ns: %j', hostname, synced ? 'done' : 'not done', nameservers); + debug(`waitForDns: ${hostname} at ns ${nameserver}: ${synced ? 'done' : 'not done'} `); if (!synced) throw new BoxError(BoxError.EXTERNAL_ERROR, 'ETRYAGAIN'); } });