src/RestApi/node_modules/diagnostics/index.js
/**
 * A simple environment based logger.
 *
 * Options:
 *
 * - colors: Force the use of colors or forcefully disable them. If this option
 *   is not supplied the colors will be based on your terminal.
 * - stream: The Stream instance we should write our logs to, defaults to
 *   process.stdout but can be anything you like.
 *
 * @param {String} name The namespace of your log function.
 * @param {Object} options Logger configuration.
 * @returns {Function} Configured logging method.
 * @api public
 */
A simple environment based logger.
Options.

- colors: Force the use of colors or forcefully disable them. If this option
is not supplied the colors will be based on your terminal.
- stream: The Stream instance we should write our logs to, defaults to
process.stdout but can be anything you like.

@param {String} name The namespace of your log function.
@param {Object} options Logger configuration.
@returns {Function} Configured logging method.
@api public
A simple environment based logger . Options . - colors : Force the use of colors or forcefully disable them . If this option is not supplied the colors will be based on your terminal . - stream : The Stream instance we should write our logs to defaults to process . stdout but can be anything you like . @param { String } name The namespace of your log function . @param { Object } options Logger configuration . @returns { Function } Configured logging method . @api public
function factory(name, options) {
  if (!enabled(name)) return function diagnopes() {};
  options = options || {};
  options.colors = 'colors' in options ? options.colors : tty;
  options.ansi = options.colors ? kuler(name, colorspace(name)) : name;
  options.stream = options.stream || stream;
   Allow multiple streams, so make sure it's an array which makes iteration
   easier.
  if (!Array.isArray(options.stream)) {
    options.stream = [options.stream];
  }
   The actual debug function which does the logging magic.
  return function debug(line) {
     Better formatting for error instances.
    if (line instanceof Error) line = line.stack || line.message || line;
    line = [
       Add the colorized namespace.
      options.ansi,
       The total time we took to execute the next debug statement.
      ' ',
      line
    ].join('');
     Use util.format so we can follow the same API as console.log.
    line = util.format.apply(this, [line].concat(
        Array.prototype.slice.call(arguments, 1)
    )) + '\n';
    options.stream.forEach(function each(stream) {
      stream.write(line);
    });
  };
}
function factory ( name , options ) { if ( ! enabled ( name ) ) return function diagnopes ( ) { } ; options = options || { } ; options . colors = 'colors' in options ? options . colors : tty ; options . ansi = options . colors ? kuler ( name , colorspace ( name ) ) : name ; options . stream = options . stream || stream ; if ( ! Array . isArray ( options . stream ) ) { options . stream = [ options . stream ] ; } return function debug ( line ) { if ( line instanceof Error ) line = line . stack || line . message || line ; line = [ options . ansi , ' ' , line ] . join ( '' ) ; line = util . format . apply ( this , [ line ] . concat ( Array . prototype . slice . call ( arguments , 1 ) ) ) + '\n' ; options . stream . forEach ( function each ( stream ) { stream . write ( line ) ; } ) ; } ; }
A simple environment based logger.
A simple environment based logger .
// // Allow multiple streams, so make sure it's an array which makes iteration // easier. // // // The actual debug function which does the logging magic. // // // Better formatting for error instances. // // // Add the colorized namespace. // // // The total time we took to execute the next debug statement. // // // Use util.format so we can follow the same API as console.log. //