Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #6 from draperlaboratory/issues/system-logs
Fixed system logs
  • Loading branch information
Rob committed Jul 26, 2016
2 parents 6c37433 + 0794011 commit 430f8efb63aa4e6c0eff22a1aa5d7fc875a7bcf9
Showing 1 changed file with 9 additions and 26 deletions.
@@ -11,6 +11,7 @@
limitations under the License.
*/
// Generated by CoffeeScript 1.9.3
// Edits have since been made.
(function() {
var ACTIVITIES, ELEMENTS, default_msg, defaults, extend, getCookie, getParameterByName, setCookie, userale,
slice = [].slice,
@@ -46,6 +47,7 @@
loggingUrl: '',
toolName: 'UNK',
toolVersion: 'UNK',
version: '3',
workerUrl: 'userale-worker.js',
debug: true,
sendLogs: true,
@@ -199,21 +201,10 @@
for (key in msg) {
value = msg[key];
if (key === 'elementType') {
value = value.toUpperCase();
if (indexOf.call(ELEMENTS, value) < 0) {
console.warn("USERALE: Unrecognized element - " + value);
} else if ((value === 'OTHER') && (msg.meta.element == null)) {
console.warn("USERALE: Element type set to 'other', but 'element' not set in meta object ");
}
msg.elementType = msg.elementType.toUpperCase();
}
if (key === 'elementGroup') {
if ((value === !'top') && (indexOf.call(this.options.elementGroups, value) < 0)) {
console.warn(value + " is NOT in element groups");
}
}
if (key === 'activity') {
activities = (function() {
msg[key] = (function() {
var j, len, ref, results1;
ref = value.split('_');
results1 = [];
@@ -223,31 +214,23 @@
}
return results1;
})();
for (j = 0, len = activities.length; j < len; j++) {
activity = activities[j];
if (indexOf.call(ACTIVITIES, activity) < 0) {
console.warn("USERALE: Unrecognized activity - " + activity);
}
}
msg[key] = activities;
}
if (key === 'source') {
value = value.toUpperCase();
if (value !== 'USER' && value !== 'SYSTEM' && value !== 'UNK') {
console.warn("USERALE: Unrecognized source - " + value);
msg[key] = null;
} else {
msg[key] = value.toUpperCase();
msg[key] = value;
}
}
}
msg.timestamp = new Date().toJSON();
msg.client = this.options.client;
msg.toolName = this.options.toolName;
msg.toolVersion = this.options.toolVersion;
msg.sessionID = this.options.sessionID;
msg.language = 'JavaScript';
msg.useraleVersion = this.options.version;
msg.toolVersion = this.options.toolVersion;
msg.toolName = this.options.toolName;
msg.client = this.options.client;
msg.sessionID = this.options.sessionID;
msg.timestamp = new Date().toJSON();
return this.worker.postMessage({
cmd: 'sendMsg',
msg: msg

0 comments on commit 430f8ef

Please sign in to comment.