From dbdc0f8391421fd8273be959841da97e34efb5f2 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 5 Mar 2018 04:11:03 +0100 Subject: [PATCH] Better Logging --- .vs/AAWebPlatform/v15/.suo | Bin 71680 -> 72192 bytes server.js | 35 ++++++++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.vs/AAWebPlatform/v15/.suo b/.vs/AAWebPlatform/v15/.suo index bb012702fc092b49ee10502a736945bd474f9100..c61023780530016bef89b13ada3797a705356352 100644 GIT binary patch delta 417 zcmXwz%}YW-6vf|+&(~8FG*ARdpQfwIUMYQ8S!P6ABdA3|i>PQ&%!(a^vblI6VZ!DFN>(`-Yb*)Tvl}Fz%rC|TxZUa#g$csIC;qjKd|4aTZk?7`IKJ1 S3$rCAj9NhiYPl9RH~s;68%hq!)5j3~I E0Hd~q6aWAK diff --git a/server.js b/server.js index 77e6e4d00..0770016d7 100644 --- a/server.js +++ b/server.js @@ -93,6 +93,12 @@ function initialize() { function readCompetitionsConfig() { + if (CONSOLE_LOG === true) { + + console.log("I am entering the readCompetitionsConfig function."); + + } + /* The file previously read contains the reference to all competiotion hosts and their competitions. We use these references to load the specific @@ -179,7 +185,7 @@ function initialize() { } catch (err) { - console.log("readCompetitionsConfig Error = " + err); + console.log("readCompetitionsConfig Error = " + err + " pData = " + pData); } } } @@ -189,6 +195,11 @@ function initialize() { function readBotsConfig() { + if (CONSOLE_LOG === true) { + + console.log("I am entering the readBotsConfig function."); + + } /* Each bot has its configuration at its own repo since each team must be able to change it at will. @@ -280,7 +291,7 @@ function initialize() { } catch (err) { - console.log("readCompetitionsConfig Error = " + err); + console.log("readBotsConfig Error = " + err + " pData = " + pData); } } } @@ -619,10 +630,22 @@ function getGithubData(pOrg, pRepo, pPath, callBackFunction) { if (cacheVersion !== undefined) { + if (CONSOLE_LOG === true) { + + console.log("getGithubData - " + pOrg + '.' + pRepo + '.' + pPath + " found at cache. :-) "); + + } + callBackFunction(cacheVersion); } else { + if (CONSOLE_LOG === true) { + + console.log("getGithubData - " + pOrg + '.' + pRepo + '.' + pPath + " NOT found at cache. :-( "); + + } + const octokit = require('@octokit/rest')() global.atob = require("atob"); @@ -638,7 +661,13 @@ function getGithubData(pOrg, pRepo, pPath, callBackFunction) { function onContent(error, result) { - if (error !== undefined) { console.log(error);} + if (CONSOLE_LOG === true) { + + console.log("getGithubData - Github.com responded to request " + pOrg + '.' + pRepo + '.' + pPath + " with result = " + result); + + } + + if (error !== null) { console.log("getGithubData -> onContent -> " + error);} let decoded = atob(result.data.content);