2022-07-14 12:25:24 -07:00
|
|
|
/**
|
|
|
|
* @author Daniel D. Scalzi
|
|
|
|
* @license CC-BY-NC 4.0 - https://creativecommons.org/licenses/by-nc/4.0/
|
|
|
|
*/
|
|
|
|
|
2018-08-22 11:21:49 -07:00
|
|
|
class LoggerUtil {
|
|
|
|
|
|
|
|
constructor(prefix, style){
|
|
|
|
this.prefix = prefix
|
|
|
|
this.style = style
|
|
|
|
}
|
|
|
|
|
|
|
|
log(){
|
|
|
|
console.log.apply(null, [this.prefix, this.style, ...arguments])
|
|
|
|
}
|
|
|
|
|
|
|
|
info(){
|
|
|
|
console.info.apply(null, [this.prefix, this.style, ...arguments])
|
|
|
|
}
|
|
|
|
|
2018-08-31 09:42:18 -07:00
|
|
|
warn(){
|
|
|
|
console.warn.apply(null, [this.prefix, this.style, ...arguments])
|
|
|
|
}
|
|
|
|
|
2018-08-22 11:21:49 -07:00
|
|
|
debug(){
|
|
|
|
console.debug.apply(null, [this.prefix, this.style, ...arguments])
|
|
|
|
}
|
|
|
|
|
|
|
|
error(){
|
|
|
|
console.error.apply(null, [this.prefix, this.style, ...arguments])
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = function (prefix, style){
|
|
|
|
return new LoggerUtil(prefix, style)
|
|
|
|
}
|