Code coverage report for monolog\lib\processor\ExpressProcessor.js

Statements: 100% (18 / 18)      Branches: 50% (1 / 2)      Functions: 100% (4 / 4)      Lines: 100% (18 / 18)      Ignored: none     

All files » monolog\lib\processor\ » ExpressProcessor.js
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62  1   1   1           1             1 1 1 1   1 1   1 1 1 1                                   1   1     1       1          
// Generated by CoffeeScript 1.6.3
var ExpressProcessor, _;
 
_ = require('underscore');
 
ExpressProcessor = (function() {
  /*
  		@param  {Express} express 
  		@return {Function}
  */
 
  function ExpressProcessor(express) {
    /*
    			processor
    			@param {monolog.Record} record 
    		 	@return {monolog.Record} [description]
    */
 
    var F;
    F = function(record) {
      Eif (record.extra == null) {
        record.extra = {};
      }
      record.extra.request = F.request;
      return record;
    };
    F.request = {};
    F.express = express;
    express.use(function(req, res, next) {
      F.request = {
        method: req.method,
        params: req.params,
        query: req.query,
        body: req.body,
        files: req.files,
        route: req.route,
        cookies: req.cookies,
        signedCookies: req.signedCookies,
        ip: req.id,
        path: req.path,
        host: req.host,
        fresh: req.fresh,
        stale: req.stale,
        xhr: req.xhr,
        protocole: req.protocol,
        secure: req.secure
      };
      return next();
    });
    return F;
  }
 
  return ExpressProcessor;
 
})();
 
module.exports = ExpressProcessor;
 
/*
//@ sourceMappingURL=ExpressProcessor.map
*/