28 lines
655 B
JavaScript
28 lines
655 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
|
|
*/
|
|
print: function(type, message)
|
|
{
|
|
if (type == __LOG_INFO)
|
|
{
|
|
console.log('[INFORMACIÓN] -> ' + message);
|
|
}
|
|
else if(type == __LOG_WARNING)
|
|
{
|
|
console.log('[ADVERTENCIA] -> ' + message);
|
|
}
|
|
else if(type == __LOG_ERROR)
|
|
{
|
|
console.log('[ERROR] -> ' + message);
|
|
}
|
|
}
|
|
} |