Sha256: 52225f61ddc5e41d70112982f329dec1226f8751c9a33f022149579269ef6b60

Contents?: true

Size: 925 Bytes

Versions: 17

Compression:

Stored size: 925 Bytes

Contents

/*!
 * Connect - logger
 * Copyright(c) 2010 Sencha Inc.
 * Copyright(c) 2011 TJ Holowaychuk
 * MIT Licensed
 */

/**
 * Module dependencies.
 */

var morgan = require('morgan');
var utils = require('../utils');

/**
 * Undeprecate default format.
 */

Object.defineProperty(morgan, 'default', {
  configurable: true,
  enumerable: true,
  value: morgan.combined
});

/**
 * Logger:
 *
 * Log requests with the given `options` or a `format` string.
 *
 * See [morgan](https://github.com/expressjs/morgan)
 *
 * @param {String|Function|Object} format or options
 * @return {Function}
 * @api public
 */

module.exports = function logger(options) {
  var format = 'default';
  var opts = options;

  if (options && typeof options === 'object') {
    format = options.format || format;
  } else {
    format = options || format;
    opts = undefined;
  }

  return morgan(format, opts);
};

utils.merge(module.exports, morgan);

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/connect/lib/middleware/logger.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/connect/lib/middleware/logger.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/connect/lib/middleware/logger.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/connect/lib/middleware/logger.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/connect/lib/middleware/logger.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/connect/lib/middleware/logger.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/connect/lib/middleware/logger.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/connect/lib/middleware/logger.js