code: function app() {
      if (arguments.length > 0) {
          if (typeof arguments[0] !== 'object') {
              throw new TypeError('Argument format must be a object');
          }
          //Validate options provided
          validateOptions(arguments[0]);
      }
  
      return function(req, res, done) {
          //0. Check directory exists
          checkFolderExists(options.dir);
  
          currentDate = new Date();
  
          function logRequest() {
  
              fomart = ':method :statusCode :url :date :response-time\n';
              fomart = fomart.replace(':method', req.method);
              fomart = fomart.replace(':url', formatUrl(req));
              fomart = fomart.replace(':statusCode', res.statusCode);
              fomart = fomart.replace(':date', formatDate(new Date()));
              fomart = fomart.replace(':response-time', responseTime(res));
              fs.appendFile(path.join(options.dir, options.file), fomart, 'utf8', function(err) {
                  if (err) throw err;
              });
          }
  
          //1. Log Response Start
          onHeaders(res, logTime);
  
  
          //2. log when response finished
          onFinished(res, logRequest);
  
          done();
      }
  }
docs: [app middleware]
  @return {function} [middleware]