From 2ecf65f05702075175b211161f05b5e2c57d9182 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 23 Jan 2017 09:28:48 +0000 Subject: [PATCH] Keep the logs if no store exists --- src/vector/rageshake.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vector/rageshake.js b/src/vector/rageshake.js index 7d1a93efc..3cc158864 100644 --- a/src/vector/rageshake.js +++ b/src/vector/rageshake.js @@ -80,11 +80,15 @@ class ConsoleLogger { /** * Retrieve log lines to flush to disk. + * @param {boolean} keepLogs True to not delete logs after flushing. * @return {string} \n delimited log lines to flush. */ - flush() { + flush(keepLogs) { // The ConsoleLogger doesn't care how these end up on disk, it just // flushes them to the caller. + if (keepLogs) { + return this.logs; + } const logsToFlush = this.logs; this.logs = ""; return logsToFlush; @@ -470,7 +474,7 @@ module.exports = { } else { logs.push({ - lines: logger.flush(), + lines: logger.flush(true), id: "-", }); }