From 5e35d88586a29732e3b39bb081bf4dfba8463038 Mon Sep 17 00:00:00 2001 From: hnouts <hnouts@grandlyon.com> Date: Tue, 4 Jul 2023 14:30:35 +0200 Subject: [PATCH] resolving threads about logs --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 1cddbc5..65a9546 100644 --- a/src/index.js +++ b/src/index.js @@ -221,7 +221,7 @@ async function authenticate(login, password, baseUrl, apiAuthKey) { return resp.data } else { const errorMessage = `Authentication failed. Response data: ${resp.data.libelleRetour}` - log('error', errorMessage) + log('debug', errorMessage) throw new Error(`code retour ko : ${resp.data.codeRetour}`) } } catch (error) { @@ -236,6 +236,8 @@ async function authenticate(login, password, baseUrl, apiAuthKey) { } async function getData(response, baseUrl, apiAuthKey) { + log('debug', 'Start date : ' + startDate) + log('debug', 'End date : ' + endDate) const dataRequest = { method: 'post', url: baseUrl + '/getAllAgregatsByAbonnement.aspx', @@ -346,6 +348,8 @@ function format(response) { * Save data in the right doctype db and prevent duplicated keys */ async function storeData(data, doctype, filterKeys) { + log('debug', 'Store into ' + doctype) + log('debug', 'Store into keys : ' + filterKeys) const filteredDocuments = await hydrateAndFilter(data, doctype, { keys: filterKeys, }) -- GitLab