initial commit
This commit is contained in:
commit
4b60ece582
327 changed files with 28286 additions and 0 deletions
18
magnus/lib/log.js
Normal file
18
magnus/lib/log.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
var Winston = require("winston");
|
||||
var config = require("../config");
|
||||
var ENV = config.get('build');
|
||||
|
||||
function getLogger(module) {
|
||||
var path = module.filename.split('/').slice(-2).join('/');
|
||||
|
||||
return new Winston.Logger({
|
||||
transports: [
|
||||
new Winston.transports.Console({
|
||||
colorize: true,
|
||||
level: ENV == 'debug' ? 'debug' : 'error'
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = getLogger;
|
Loading…
Add table
Add a link
Reference in a new issue