Commit 6961fd0b authored by Cory Bryant's avatar Cory Bryant

Fix labels

parent e360d979
......@@ -8,9 +8,9 @@ module.exports=function(config){
var logMaker={};
var delegates = {};
var transports=[];
var defaultTransports=[];
if(_.get(config,"console")){
transports.push( new (winston.transports.Console)(
defaultTransports.push( new (winston.defaultTransports.Console)(
_.defaults({
name: "console",
timestamp: function () {
......@@ -19,12 +19,12 @@ module.exports=function(config){
}, config.console)) );
}
if(_.get(config,"files.firehose")){
transports.push( new (winston.transports.File)(_.defaults({name: "firehose"}, config.files.firehose)) );
defaultTransports.push( new (winston.transports.File)(_.defaults({name: "firehose"}, config.files.firehose)) );
}
var blLevels={
levels:{
trace:4,
trace:5,
debug:4,
info:3,
warning:2,
......@@ -46,7 +46,7 @@ module.exports=function(config){
logMaker.addTransport=function(transport) {
if (transport != null) {
transports.push(transport);
defaultTransports.push(transport);
}
}
......@@ -55,6 +55,13 @@ module.exports=function(config){
var delegate={};
var transports = [];
defaultTransports.forEach(transport => {
var newTransport = Object.assign({}, transport);
newTransport.label=label;
transports.push(newTransport);
});
winston.loggers.add(label,{
transports: transports
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment