29 lines
703 B
JavaScript
29 lines
703 B
JavaScript
|
|
/**
|
|
* Tipos de advertencias
|
|
*/
|
|
global.__LOG_INFO = 1;
|
|
global.__LOG_WARNING = 2;
|
|
global.__LOG_ERROR = 3;
|
|
|
|
module.exports = {
|
|
/**
|
|
* Imprimir advertencia directamente en consola
|
|
* @param {Integer} type Constante tipo de advertencia
|
|
* @param {String} message Mensaje a mostrar
|
|
*/
|
|
print: function(type, message) {
|
|
switch (type) {
|
|
case __LOG_INFO:
|
|
console.log(`[INFO] -> ${message}`);
|
|
break;
|
|
case __LOG_WARNING:
|
|
console.log(`[WARN] -> ${message}`);
|
|
break;
|
|
case __LOG_ERROR:
|
|
console.log(`[ERROR] -> ${message}`);
|
|
break;
|
|
}
|
|
}
|
|
};
|