-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlogger.js
33 lines (33 loc) · 956 Bytes
/
logger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module.exports = {
log: function() {
var msg = arguments[1];
var args = Array.prototype.slice.call(arguments);
var a = ['[foundation-sites-loader]: ' + msg];
a = a.concat(args.slice(2));
console.log.apply(null, a);
},
/**
* Print verbose level message.
* @param {object} config Configuration object
* @param {string} msg Message to display, can contain %O, %s, etc.
* @returns {void}
* Add additional arguments as needed for formatting of msg
*/
verbose: function(config, msg) {
if (config.verbose) {
this.log.apply(this, arguments);
}
},
/**
* Print debug level message.
* @param {object} config Configuration object
* @param {string} msg Message to display, can contain %O, %s, etc.
* @returns {void}
* Add additional arguments as needed for formatting of msg
*/
debug: function(config, msg) {
if (config.debug) {
this.log.apply(this, arguments);
}
}
};