From e0fa02b38cca0f687b5dd834a8f6404e0668fb2b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 9 Aug 2020 10:46:14 +0200 Subject: [PATCH] Logs Cleaned --- Commons.js | 2 +- DataDependencies.js | 20 +++++++------------ DataSet.js | 3 --- FileStorage.js | 3 --- IndicatorOutput.js | 4 ---- LowFrequencyTrading/TradingOrders.js | 2 +- ProcessExecutionEvents.js | 4 ---- Root.js | 29 ++++------------------------ StatusDependencies.js | 7 ------- StatusReport.js | 3 --- 10 files changed, 13 insertions(+), 64 deletions(-) diff --git a/Commons.js b/Commons.js index f3b4cc853..3f5642205 100644 --- a/Commons.js +++ b/Commons.js @@ -75,7 +75,7 @@ return } if (outputDatasetNode.referenceParent.parentNode.dataBuilding === undefined) { - logger.write(MODULE_NAME, "[WARN] start -> Product Definition " + outputDatasetNode.referenceParent.parentNode.name + " without a Data Building Procedure. Product Definition = " + JSON.stringify(outputDatasetNode.referenceParent.parentNode)); + logger.write(MODULE_NAME, "[WARN] start -> Product Definition " + outputDatasetNode.referenceParent.parentNode.name + " without a Data Building Procedure. Product Definition Name = " + outputDatasetNode.referenceParent.parentNode.name); } if (outputDatasetNode.referenceParent.config.codeName === undefined) { logger.write(MODULE_NAME, "[ERROR] start -> Dataset witn no codeName defined. Product Dataset = " + JSON.stringify(outputDatasetNode.referenceParent)); diff --git a/DataDependencies.js b/DataDependencies.js index 918def0bf..44287c682 100644 --- a/DataDependencies.js +++ b/DataDependencies.js @@ -4,12 +4,12 @@ const LOG_FILE_CONTENT = false; const MODULE_NAME = "Data Dependencies"; - let bot = BOT + let bot = BOT let thisObject = { nodeArray: undefined, dataSetsModulesArray: [], - isItADepenency: isItADepenency, + isItADepenency: isItADepenency, initialize: initialize, finalize: finalize }; @@ -21,9 +21,6 @@ function initialize(callBackFunction) { try { - - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); } - /* Basic Valdidations */ if (bot.processNode.referenceParent.processDependencies !== undefined) { if (bot.processNode.referenceParent.processDependencies.dataDependencies !== undefined) { @@ -51,7 +48,7 @@ if (bot.DEPENDENCY_FILTER !== undefined) { for (let i = 0; i < bot.DEPENDENCY_FILTER.length; i++) { let key = bot.DEPENDENCY_FILTER[i] - filter.set(key, true) + filter.set(key, true) } } @@ -70,7 +67,7 @@ function onInitilized(err) { if (err.result !== global.DEFAULT_OK_RESPONSE.result) { - logger.write(MODULE_NAME, "[ERROR] initialize -> onInitilized -> err = "+ JSON.stringify(err)); + logger.write(MODULE_NAME, "[ERROR] initialize -> onInitilized -> err = " + JSON.stringify(err)); alreadyCalledBack = true; callBackFunction(err); @@ -81,9 +78,6 @@ } function addDataSet() { - - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> addDataSet -> Entering function."); } - addCount++; thisObject.dataSetsModulesArray.push(dataSetModule); @@ -99,14 +93,14 @@ } } catch (err) { - logger.write(MODULE_NAME, "[ERROR] initialize -> err = "+ err.stack); + logger.write(MODULE_NAME, "[ERROR] initialize -> err = " + err.stack); callBackFunction(global.DEFAULT_FAIL_RESPONSE); } } function finalize() { for (let i = 0; i < thisObject.dataSetsModulesArray.length; i++) { - let dataSetModule = thisObject.dataSetsModulesArray[i] + let dataSetModule = thisObject.dataSetsModulesArray[i] dataSetModule.finalize() } thisObject.dataSetsModulesArray = undefined @@ -115,7 +109,7 @@ } function isItADepenency(timeFrame, product) { - let key = timeFrame + '-' + product + let key = timeFrame + '-' + product return filter.get(key) } diff --git a/DataSet.js b/DataSet.js index bb7f789e3..fe188ba16 100644 --- a/DataSet.js +++ b/DataSet.js @@ -23,9 +23,6 @@ exports.newDataSet = function newDataSet(BOT, logger) { function initialize(dataDependency, callBackFunction) { try { - - if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); } - thisObject.node = dataDependency.referenceParent; logger.fileName = MODULE_NAME + "." + thisObject.node.type + "." + thisObject.node.name + "." + thisObject.node.id; diff --git a/FileStorage.js b/FileStorage.js index f47b86545..9b9245883 100644 --- a/FileStorage.js +++ b/FileStorage.js @@ -31,9 +31,6 @@ exports.newFileStorage = function newFileStorage(logger, host, port) { recursiveGetTextFile(filePath, callBackFunction, noRetry, canUsePrevious) function recursiveGetTextFile(filePath, callBackFunction, noRetry, canUsePrevious) { - - logger.write(MODULE_NAME, '[INFO] FileStorage -> getTextFile -> Entering Function.') - let fileDoesNotExist = false /* Choose path for either bots or data */ diff --git a/IndicatorOutput.js b/IndicatorOutput.js index 3faa4052e..0ae431043 100644 --- a/IndicatorOutput.js +++ b/IndicatorOutput.js @@ -24,14 +24,10 @@ } function initialize(callBackFunction) { - try { - logger.fileName = MODULE_NAME; logger.initialize(); - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); } - callBackFunction(global.DEFAULT_OK_RESPONSE); } catch (err) { diff --git a/LowFrequencyTrading/TradingOrders.js b/LowFrequencyTrading/TradingOrders.js index 609f7d987..530277879 100644 --- a/LowFrequencyTrading/TradingOrders.js +++ b/LowFrequencyTrading/TradingOrders.js @@ -81,7 +81,7 @@ exports.newTradingOrders = function newTradingOrders(bot, logger, tradingEngineM try { if (tradingEngineOrder.status === undefined) { continue } } catch (err) { - + console.log(err.stack) } diff --git a/ProcessExecutionEvents.js b/ProcessExecutionEvents.js index b304be111..c45f64ddd 100644 --- a/ProcessExecutionEvents.js +++ b/ProcessExecutionEvents.js @@ -29,11 +29,7 @@ return thisObject; function initialize(callBackFunction) { - try { - - if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); } - let name = 'Not Depends on any Process' logger.fileName = MODULE_NAME + "." + name; diff --git a/Root.js b/Root.js index 06b1fe77b..209ae43ab 100644 --- a/Root.js +++ b/Root.js @@ -56,50 +56,29 @@ /* Global control of logging. */ global.LOG_CONTROL = { - "Assistant": { - logInfo: true, - logWarnings: false, - logErrors: true, - logContent: false, - intensiveLogging: false - }, - "Exchange API": { - logInfo: true, - logWarnings: false, - logErrors: true, - logContent: false, - intensiveLogging: false - }, "Status Report": { - logInfo: true, + logInfo: false, logWarnings: false, logErrors: true, logContent: false, intensiveLogging: false }, "Dataset": { - logInfo: true, - logWarnings: false, - logErrors: true, - logContent: false, - intensiveLogging: false - }, - "Context": { - logInfo: true, + logInfo: false, logWarnings: false, logErrors: true, logContent: false, intensiveLogging: false }, "Process Execution Events": { - logInfo: true, + logInfo: false, logWarnings: false, logErrors: true, logContent: false, intensiveLogging: false }, "Process Output": { - logInfo: true, + logInfo: false, logWarnings: false, logErrors: true, logContent: false, diff --git a/StatusDependencies.js b/StatusDependencies.js index 21314c4c8..2b3615e32 100644 --- a/StatusDependencies.js +++ b/StatusDependencies.js @@ -18,11 +18,7 @@ return thisObject; function initialize(callBackFunction) { - try { - - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); } - /* Basic Valdidations */ if (bot.processNode.referenceParent.processDependencies !== undefined) { if (bot.processNode.referenceParent.processDependencies.statusDependencies !== undefined) { @@ -88,9 +84,6 @@ switch (err.message) { case global.DEFAULT_OK_RESPONSE.message: { - - if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] initialize -> onLoad -> Execution finished well. -> Status Dependency = " + JSON.stringify(statusDependency.dependency)) } - addReport(); return; } diff --git a/StatusReport.js b/StatusReport.js index 4da076767..d39a254fb 100644 --- a/StatusReport.js +++ b/StatusReport.js @@ -39,10 +39,7 @@ return thisObject; function initialize(pStatusDependencyNode, callBackFunction) { - try { - if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] initialize -> Entering function."); } - statusDependencyNode = pStatusDependencyNode; logger.fileName = MODULE_NAME + "." + statusDependencyNode.type + "." + statusDependencyNode.name + "." + statusDependencyNode.id;