Skip to content

Commit

Permalink
clean log and error utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed May 8, 2017
1 parent a409412 commit be3cb34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,19 @@
* @param {String} msg
*/
var log = function (msg) {
if (Moon.config.silent === false) console.log(msg);
if (Moon.config.silent === false) {
console.log(msg);
}
};

/**
* Throws an Error
* @param {String} msg
*/
var error = function (msg) {
if (Moon.config.silent === false) console.error("[Moon] ERR: " + msg);
if (Moon.config.silent === false) {
console.error("[Moon] ERR: " + msg);
}
};

/**
Expand Down
8 changes: 6 additions & 2 deletions src/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ const backslashRE = /\\/g;
* @param {String} msg
*/
const log = function(msg) {
if(Moon.config.silent === false) console.log(msg);
if(Moon.config.silent === false) {
console.log(msg);
}
}

/**
* Throws an Error
* @param {String} msg
*/
const error = function(msg) {
if(Moon.config.silent === false) console.error("[Moon] ERR: " + msg);
if(Moon.config.silent === false) {
console.error("[Moon] ERR: " + msg);
}
}

/**
Expand Down

0 comments on commit be3cb34

Please sign in to comment.