Logs with folders per Year / Month
This commit is contained in:
1 parent
7064de6e01
commit
24ceee1e94
3 files changed
+27
-1
No files matched your search
Binary file not shown.
@@ -78,6 +78,21 @@
|
||||
folderToRemove = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor + "/" + thisObject.bot.process + "/Loop." + (loopCounter - global.PLATFORM_CONFIG.maxLogLoops).toString();
|
||||
|
||||
rimraf.sync(folderToRemove);
|
||||
|
||||
if (thisObject.bot.debug.year !== undefined) {
|
||||
|
||||
folderPath = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor + "/" + thisObject.bot.process + "/Loop." + loopCounter + "/" + thisObject.bot.debug.year;
|
||||
|
||||
createFolderSync(folderPath);
|
||||
|
||||
if (thisObject.bot.debug.month !== undefined) {
|
||||
|
||||
folderPath = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor + "/" + thisObject.bot.process + "/Loop." + loopCounter + "/" + thisObject.bot.debug.year + "/" + thisObject.bot.debug.month;
|
||||
|
||||
createFolderSync(folderPath);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Error trying to create the loop folder needed or deleting old ones. Error: " + err.message);
|
||||
|
||||
@@ -159,6 +159,7 @@ for (let p = 0; p < global.PLATFORM_CONFIG.executionList.length; p++) {
|
||||
}
|
||||
|
||||
botConfig.process = listItem.process;
|
||||
botConfig.debug = {};
|
||||
|
||||
logger = DEBUG_MODULE.newDebugLog();
|
||||
logger.fileName = MODULE_NAME;
|
||||
@@ -200,10 +201,15 @@ for (let p = 0; p < global.PLATFORM_CONFIG.executionList.length; p++) {
|
||||
|
||||
if (FULL_LOG === true) { logger.write("[INFO] run -> allMonths start mode detected. "); }
|
||||
|
||||
for (let year = processConfig.startMode.allMonths.maxYear; year > processConfig.startMode.allMonths.minYear; year--) {
|
||||
for (let year = processConfig.startMode.allMonths.maxYear; year >= processConfig.startMode.allMonths.minYear; year--) {
|
||||
|
||||
for (let month = 12; month > 0; month--) {
|
||||
|
||||
botConfig.debug = {
|
||||
month: pad(month, 2),
|
||||
year: pad(year, 4)
|
||||
};
|
||||
|
||||
let timeDelay = Math.random() * 10 * 1000; // We introduce a short delay so as to not overload the machine.
|
||||
setTimeout(startProcess, timeDelay);
|
||||
|
||||
@@ -242,6 +248,11 @@ for (let p = 0; p < global.PLATFORM_CONFIG.executionList.length; p++) {
|
||||
let month = pad(processConfig.startMode.oneMonth.month, 2);
|
||||
let year = processConfig.startMode.oneMonth.year;
|
||||
|
||||
botConfig.debug = {
|
||||
month: pad(month, 2),
|
||||
year: pad(year, 4)
|
||||
};
|
||||
|
||||
switch (botConfig.type) {
|
||||
case 'Extraction': {
|
||||
runExtractionBot(processConfig, month, year);
|
||||
|
||||
Reference in new issue
Block a user