1
0
mirror of synced 2024-11-16 19:13:49 +00:00
SecurityCam.js/logger.js
2016-08-07 11:02:21 +02:00

32 lines
467 B
JavaScript

var moment = require('moment');
var logger = {};
function log(level, message)
{
console.log('[' + moment().format() + '] ' + level + ': ' + message);
}
logger.verbose = function(message)
{
log('Verbose', message);
}
logger.info = function(message)
{
log('Info', message);
}
logger.warning = function(message)
{
log('Warning', message);
}
logger.error = function(message)
{
log('Error', message);
}
module.exports = logger;