Jump To …
winston/config/cli-config.html winston/config/npm-config.html winston/config/syslog-config.html winston/config.html winston/internal.html winston/logger.html winston/transports/console.html winston/transports/file.html winston/transports/loggly.html winston/transports/webhook.html winston/transports.html winston.html

# config.js |
--- | ---
¶ |
    /*
     * 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;
    };