[feature] Add color option to pattern layout.

Based on #90 this implements the possibillity to add the color codes
according to the log level via %[ and %].
This commit is contained in:
Friedel Ziegelmayer
2012-11-22 22:14:13 +01:00
parent a9307fd6da
commit 4a7a90ed53
2 changed files with 37 additions and 26 deletions

View File

@@ -243,9 +243,9 @@ vows.describe('log4js layouts').addBatch({
test(args, '%-6p', 'DEBUG ');
test(args, '%-8p', 'DEBUG ');
test(args, '%-10p', 'DEBUG ');
},
'%[%r%] should output colored time': function(args) {
test(args, '%[%r%]', '\033[36m14:18:30\033[39m');
}
}
}).export(module);