Added exports for logs and handlers to make testing easier
Project: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/commit/35c7272c Tree: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/tree/35c7272c Diff: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/diff/35c7272c Branch: refs/heads/SENSSOFT-192 Commit: 35c7272c2944ee99fb10352edf31c273010606c9 Parents: 8e4a9ed Author: Rob Foley <rob.foley...@gmail.com> Authored: Wed Sep 13 09:28:59 2017 -0700 Committer: Rob Foley <rob.foley...@gmail.com> Committed: Wed Sep 13 09:28:59 2017 -0700 ---------------------------------------------------------------------- src/packageLogs.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/35c7272c/src/packageLogs.js ---------------------------------------------------------------------- diff --git a/src/packageLogs.js b/src/packageLogs.js index 8e27d28..12a5374 100644 --- a/src/packageLogs.js +++ b/src/packageLogs.js @@ -15,7 +15,7 @@ * limitations under the License. */ -var logs; +export var logs; var config; // Interval Logging Globals @@ -26,8 +26,8 @@ var intervalTimer; var intervalCounter; var intervalLog; -var filterHandler = null; -var mapHandler = null; +export var filterHandler = null; +export var mapHandler = null; /** * Assigns a handler to filter logs out of the queue. @@ -54,6 +54,8 @@ export function setLogMapper(callback) { export function initPackager(newLogs, newConfig) { logs = newLogs; config = newConfig; + filterHandler = null; + mapHandler = null; intervalID = null; intervalType = null; intervalPath = null; @@ -94,7 +96,7 @@ export function packageLog(e, detailFcn) { 'sessionID': config.sessionID }; - if (typeof filterHandler === 'function' && !filterHandler(log)) { + if ((typeof filterHandler === 'function') && !filterHandler(log)) { return false; }