Skip to content

Commit

Permalink
logging tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkneen committed Apr 21, 2017
1 parent 30dbeac commit 97dcced
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions reste.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ var main = function() {

// generic log handler in DEV mode
function log(message) {
if (config.debug) {
if (config.debug && message) {
console.log("::RESTE::" + message);
}
}

// generic log handler in DEV mode
function warn(message) {
console.warn("::RESTE::" + message);
if (config.debug && message) {
console.warn("::RESTE::" + message);
}
}

// sets up the config, headers, adds methods
Expand Down Expand Up @@ -154,7 +156,7 @@ var main = function() {
e.url = args.url;

function retry() {
log("Retrying");
log("Retrying...");
makeHttpRequest(args, onLoad, onError);
}

Expand Down Expand Up @@ -457,7 +459,7 @@ var main = function() {
// Intercept sync to handle collections / models
Backbone.sync = function(method, model, options) {
if (config.debug) {
log(method + model._type);
log("Backbone.sync: " + method + model._type);
}


Expand Down

0 comments on commit 97dcced

Please sign in to comment.