Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting fixes #16

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

fix formatting

  • Loading branch information
jacksonhoose committed Mar 23, 2015
commit e947eb70d7a9d254677261f5315243ec4ba0bef0
@@ -15,45 +15,45 @@

function LogglyTracker() {
this.key = false;
this.sendConsoleErrors = false;
}
this.sendConsoleErrors = false;
}

function setKey(tracker, key) {
tracker.key = key;
tracker.setSession();
setInputUrl(tracker);
}

function setSendConsoleError(tracker, sendConsoleErrors) {
tracker.sendConsoleErrors = sendConsoleErrors;
if(tracker.sendConsoleErrors === true){
var _onerror = window.onerror;
//send console error messages to Loggly
window.onerror = function (msg, url, line, col){
tracker.push({
category: 'BrowserJsException',
exception: {
message: msg,
url: url,
lineno: line,
colno: col,
}
});
if (_onerror && typeof _onerror === 'function') {
_onerror.apply(window, arguments);
}
};
}
}
function setSendConsoleError(tracker, sendConsoleErrors) {
tracker.sendConsoleErrors = sendConsoleErrors;
if(tracker.sendConsoleErrors === true) {
var _onerror = window.onerror;
//send console error messages to Loggly
window.onerror = function (msg, url, line, col) {
tracker.push({
category: 'BrowserJsException',
exception: {
message: msg,
url: url,
lineno: line,
colno: col,
}
});
if (_onerror && typeof _onerror === 'function') {
_onerror.apply(window, arguments);
}
};
}
}

function setInputUrl(tracker) {
tracker.inputUrl = LOGGLY_INPUT_PREFIX
+ (tracker.logglyCollectorDomain || LOGGLY_COLLECTOR_DOMAIN)
+ '/inputs/'
+ tracker.key
+ LOGGLY_INPUT_SUFFIX;
+ LOGGLY_INPUT_SUFFIX;
}

LogglyTracker.prototype = {
@@ -79,7 +79,7 @@
var self = this;


if(type === 'string') {
if(type === 'string') {
data = {
'text': data
};
@@ -89,11 +89,11 @@
return;
}

if(data.sendConsoleErrors !== undefined) {
setSendConsoleError(self, data.sendConsoleErrors);
}
if(data.logglyKey) {
if(data.sendConsoleErrors !== undefined) {
setSendConsoleError(self, data.sendConsoleErrors);
}
if(data.logglyKey) {
setKey(self, data.logglyKey);
return;
}
@@ -110,7 +110,6 @@

self.track(data);


},
track: function(data) {
// inject session id
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.