34 lines
585 B
JavaScript
34 lines
585 B
JavaScript
const utils = require('./utils');
|
|
|
|
function warning(msg) {
|
|
internalLog('[WARNING]', msg);
|
|
}
|
|
|
|
function info(msg) {
|
|
internalLog('[INFO]', msg);
|
|
}
|
|
|
|
function error(msg) {
|
|
internalLog('[ERROR]', msg);
|
|
}
|
|
|
|
function alert(msg) {
|
|
internalLog('[ALERT]', msg);
|
|
}
|
|
|
|
function debug(msg) {
|
|
if (!utils.isOnlineEnv()) {
|
|
internalLog('[DEBUG]', msg);
|
|
}
|
|
}
|
|
|
|
function internalLog(logClass, msg) {
|
|
console.log(utils.formatDate(new Date()) + ' ' + logClass + ' ' + msg);
|
|
}
|
|
|
|
exports.warning = warning;
|
|
exports.info = info;
|
|
exports.alert = alert;
|
|
exports.error = error;
|
|
exports.debug = debug;
|