NicolasSiver/nodebb-widget-ns-stats

View on GitHub
widget/logger.js

Summary

Maintainability
A
0 mins
Test Coverage
(function (Module) {
    'use strict';

    var winston = require('winston');

    Module.exports = new (winston.Logger)({
        transports: [
            new (winston.transports.Console)({
                colorize : true,
                timestamp: function () {
                    var date = new Date();
                    return date.getDate() + '/' + (date.getMonth() + 1) + ' ' + date.toTimeString().substr(0, 5) + ' [' + global.process.pid + ']';
                },
                level    : global.env === 'production' ? 'info' : 'verbose',
                label    : 'widgets/stats'
            })
        ]
    });

})(module);