From b3d5c293f55a0345ab3102adc94cc2bfbb2a8b25 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 17 Oct 2019 09:31:14 +0200 Subject: [PATCH] Logging at user defined folderName in sessions objects --- DebugLog.js | 6 +++++- Session.js | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DebugLog.js b/DebugLog.js index cf1a694c1..e996fe4dd 100644 --- a/DebugLog.js +++ b/DebugLog.js @@ -69,7 +69,11 @@ exports.newDebugLog = function newDebugLog() { let filePath = thisObject.bot.filePathRoot + "/Logs/" + thisObject.bot.process + "/" if (thisObject.bot.SESSION !== undefined) { - filePath = filePath + thisObject.bot.SESSION.id + "/" + executionDatetime; + if (thisObject.bot.SESSION.code.folderName === undefined) { + filePath = filePath + thisObject.bot.SESSION.id + "/" + executionDatetime; + } else { + filePath = filePath + thisObject.bot.SESSION.code.folderName + "/" + executionDatetime; + } } else { filePath = filePath + executionDatetime; } diff --git a/Session.js b/Session.js index 5ff67d6f6..181a0b726 100644 --- a/Session.js +++ b/Session.js @@ -16,7 +16,8 @@ /* Initialize this info so that everything is logged propeerly */ bot.SESSION = { name: bot.processNode.session.name, - id: bot.processNode.session.id + id: bot.processNode.session.id, + code: bot.processNode.session.code } /* Check if there is a session */