d32c869fe3964b43041953f914530a743f8ecace.svn-base
928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* config.js: Default settings for all levels that winston knows about
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*
*/
var colors = require('colors');
var config = exports,
allColors = exports.allColors = {};
config.addColors = function (colors) {
mixin(allColors, colors);
};
config.colorize = function (level) {
return level[allColors[level]];
};
//
// Export config sets
//
config.cli = require('./config/cli-config');
config.npm = require('./config/npm-config');
config.syslog = require('./config/syslog-config');
//
// Add colors for pre-defined config sets
//
config.addColors(config.npm.colors);
config.addColors(config.syslog.colors);
function mixin (target) {
var args = Array.prototype.slice.call(arguments, 1);
args.forEach(function (a) {
var keys = Object.keys(a);
for (var i = 0; i < keys.length; i++) {
target[keys[i]] = a[keys[i]];
}
});
return target;
};